Commit 96069979 authored by Sylvain Coulange's avatar Sylvain Coulange

colorisation boutons + encadrement des tokens quand affichage du tag

parent 529c059d
......@@ -2,8 +2,8 @@ from django.shortcuts import render
from django.http import JsonResponse
import re, json, spacy, subprocess
nlpFr = spacy.load('fr_core_news_lg')
nlpZh = spacy.load('zh_core_web_lg')
nlpFr = spacy.load('fr_core_news_md')
nlpZh = spacy.load('zh_core_web_md')
def home(request):
updateTimeStr = updateTime()
......
......@@ -89,6 +89,12 @@ async function runSpacy() {
var outText = document.getElementById('outText');
outText.innerHTML = result;
// On relance switchTags() si il était actif
if (tags) {
switchTags();
switchTags();
}
}
function getExample() {
......@@ -112,12 +118,14 @@ function switchTags(){
if (tags) { // Masque les étiquettes morphosyntaxiques
for (i=0; i<tokens.length; i++){
tokens[i].title = '';
tokens[i].classList = "token";
}
divBtnTags.style.border = "1px solid transparent";
} else { // Affiche les étiquettes morphosyntaxiques
for (i=0; i<tokens.length; i++){
tokens[i].title = tokens[i].getAttribute('title-data');
tokens[i].classList = "token tokenborder";
}
divBtnTags.style.border = "1px solid green";
}
......
......@@ -25,7 +25,7 @@ var langJson = {
},
"sp_subtitle": {
"fr": "<span style='color:#00b54a'>Coloriseur</span> <span style='color:#980086'>grammatical</span> <span style='color:#fff'>et</span> <span style='color:#980086'>automatique</span> <span style='color:#c00018'>de</span> <span style='color:#00b54a'>texte</span>",
"zh": ""
"zh": "<span style='color:#980086'>自動</span><span style='color:#00b54a'>語法</span><span style='color:#fff'>和</span><span style='color:#00b54a'>文本着色器</span>"
},
"sp_consigne": {
"fr": "Entrez du texte à analyser :",
......
......@@ -24,18 +24,29 @@ body {
padding: 0px;
}
h1 {
font-size: 3em;
}
h2 {
padding: 10px;
font-size: 1.5em;
font-size: 2em;
font-weight: bold;
margin: auto;
}
.contours {
-webkit-text-stroke-width: 0.7px;
-webkit-text-stroke-width: 0.5px;
-webkit-text-stroke-color: black;
}
button {
border-radius: 5px;
margin: 5px;
padding: 2px 18px;
}
.outputParam {
position: absolute;
right: 0px;
......@@ -159,3 +170,9 @@ footer {
.btntags {
border: 1px solid transparent;
}
.tokenborder:hover {
border: 1px solid rgba(255, 255, 255, 0.74);
border-radius: 5px;
padding-top: 10px;
}
\ No newline at end of file
......@@ -30,8 +30,8 @@
<button onclick="getExample()"><span id="sp_exemple" class="langspan"></span></button>
</div>
<textarea class="inText" id="inText"></textarea>
<button onclick="runSpacy()"><span id="sp_analyser" class="langspan"></span></button>
<button onclick="erase()"><span id="sp_effacer" class="langspan"></span></button>
<button style="background-color: rgb(179, 247, 179);" onclick="runSpacy()"><span id="sp_analyser" class="langspan"></span></button>
<button style="background-color: rgb(221, 221, 221);" onclick="erase()"><span id="sp_effacer" class="langspan"></span></button>
</div>
<div id="outputDiv" class="win-black outputMainDiv">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment