Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit ea78d0fe authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

add new English dictionary (cmu) + debug main.js

parent be7d2572
......@@ -87,6 +87,7 @@ var loc2stand = {
"US, UK":"US",
"Western Pennsylvania":"US",
"New Hampshire":"US",
"US-cmu":"US",
"Canada":"CA",
"CA":"CA",
"Canadian":"CA",
......
......@@ -111,64 +111,73 @@ async function getColorisation() {
for (i=0; i<outText.length; i++) {
// REMPLISSAGE DES ZONES MOTS DANS DIV RÉSULTATS
if (outText[i][0][0][0].graph.match(/\n+/)){
for (h=0; h<outText[i][0][0][0].graph.length; h++) {
outputDiv.innerHTML = outputDiv.innerHTML + '<br>';
}
} else if (outText[i][0][0][0].graph.match(/^(,|\.|…|\)|\]|\}|%|>|»|”|-)$/)) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="phon_neutre">'+ outText[i][0][0][0].graph +'</span>';
if (outText[i][0][0][0].graph.match(/^-$/)) noSpace = true; else noSpace = false;
} else if (outText[i][0][0][0].graph.match(/\(|\[|\{|<|«|“/)) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span> </span><span class="phon_neutre">'+ outText[i][0][0][0].graph +'</span>';
noSpace = true;
} else if (noSpace) {
if (outText[i].length>1) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="tokens" id="tok'+ i +'" onclick="showAlignPop(this.id)"></span>';
} else {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="tokens" id="tok'+ i +'"></span>';
}
if (outText[i][0][0][0].graph.match(/^.+’$/)) noSpace = true; else noSpace = false;
if (outText[i][0][0] == []) {
// Sécurité: si phonigraphie est une liste vide, on tente quand même d'afficher du texte en gris
console.log("Bug outText[",i,"][0][0] is empty!");
// ici trouver code pour renvoyer txt brut
} else {
if (outText[i][0][0][0].graph.match(/^’.+$/)) { // I'll you're
if (outText[i][0][0][0].graph.match(/\n+/)){
for (h=0; h<outText[i][0][0][0].graph.length; h++) {
outputDiv.innerHTML = outputDiv.innerHTML + '<br>';
}
} else if (outText[i][0][0][0].graph.match(/^(,|\.|…|\)|\]|\}|%|>|»|”|-)$/)) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="phon_neutre">'+ outText[i][0][0][0].graph +'</span>';
if (outText[i][0][0][0].graph.match(/^-$/)) noSpace = true; else noSpace = false;
} else if (outText[i][0][0][0].graph.match(/\(|\[|\{|<|«|“/)) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span> </span><span class="phon_neutre">'+ outText[i][0][0][0].graph +'</span>';
noSpace = true;
} else if (noSpace) {
if (outText[i].length>1) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="tokens" id="tok'+ i +'" onclick="showAlignPop(this.id)"></span>';
} else {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="tokens" id="tok'+ i +'"></span>';
}
if (outText[i][0][0][0].graph.match(/^.+’$/)) noSpace = true; else noSpace = false;
} else {
if (outText[i].length>1) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span> </span><span class="tokens" id="tok'+ i +'" onclick="showAlignPop(this.id)"></span>';
if (outText[i][0][0][0].graph.match(/^’.+$/)) { // I'll you're
if (outText[i].length>1) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="tokens" id="tok'+ i +'" onclick="showAlignPop(this.id)"></span>';
} else {
outputDiv.innerHTML = outputDiv.innerHTML + '<span class="tokens" id="tok'+ i +'"></span>';
}
} else {
outputDiv.innerHTML = outputDiv.innerHTML + '<span> </span><span class="tokens" id="tok'+ i +'"></span>';
if (outText[i].length>1) {
outputDiv.innerHTML = outputDiv.innerHTML + '<span> </span><span class="tokens" id="tok'+ i +'" onclick="showAlignPop(this.id)"></span>';
} else {
outputDiv.innerHTML = outputDiv.innerHTML + '<span> </span><span class="tokens" id="tok'+ i +'"></span>';
}
}
if (outText[i][0][0][0].graph.match(/^.+’$/)) noSpace = true; else noSpace = false;
}
if (outText[i][0][0][0].graph.match(/^.+’$/)) noSpace = true; else noSpace = false;
}
// FORMATAGE DES SPANS
if (outText[i][0][0][0].graph != '\n'){
dicoTok['tok'+i] = [];
waitinglist = []; // we will put all non aligned ones here, waiting to pushing them all at the end (so that they can't appear first)
for (j=0; j<outText[i].length; j++) {
var newWord = '';
for (k=0; k<outText[i][j][0].length; k++) {
newWord = newWord + '<span class="phon '+ outText[i][j][0][k].phon +'">'+ outText[i][j][0][k].graph +'</span>';
// FORMATAGE DES SPANS
if (outText[i][0][0][0].graph != '\n'){
dicoTok['tok'+i] = [];
waitinglist = []; // we will put all non aligned ones here, waiting to pushing them all at the end (so that they can't appear first)
for (j=0; j<outText[i].length; j++) {
var newWord = '';
for (k=0; k<outText[i][j][0].length; k++) {
newWord = newWord + '<span class="phon '+ outText[i][j][0][k].phon +'">'+ outText[i][j][0][k].graph +'</span>';
}
if (outText[i][j][3].length == 0 && outText[i][j][0].length>0) {
dicoTok['tok'+i].push([newWord,outText[i][j][1],outText[i][j][2],outText[i][j][3]]);
} else {
waitinglist.push([newWord,outText[i][j][1],outText[i][j][2],outText[i][j][3]]);
}
}
if (outText[i][j][3].length == 0 && outText[i][j][0].length>0) {
dicoTok['tok'+i].push([newWord,outText[i][j][1],outText[i][j][2],outText[i][j][3]]);
} else {
waitinglist.push([newWord,outText[i][j][1],outText[i][j][2],outText[i][j][3]]);
for (l=0; l<waitinglist.length; l++){
dicoTok['tok'+i].push(waitinglist[l]);
}
}
for (l=0; l<waitinglist.length; l++){
dicoTok['tok'+i].push(waitinglist[l]);
}
}
// INITIALISATION DU dicoId
if (outText[i][0][0][0].graph != '\n'){
dicoId['tok'+i] = 0;
// INITIALISATION DU dicoId
if (outText[i][0][0][0].graph != '\n'){
dicoId['tok'+i] = 0;
}
}
}
......
......@@ -35,7 +35,8 @@ phonGraphFile = "../phon2graph/data/fidel_wikicolor.scsv" # "../phon2graph/data/
phonGraphFileEn = "../phon2graph/data/fidel_wikicolor_en.scsv" # ENGLISH
dicFile = "../wikiphon/dico_frwiktionary-20200301_v2.json"
dicFileEn = "../wikiphon/dico_enWiktionary-20200704_v1.json" # ENGLISH
#dicFileEn = "../wikiphon/dico_enWiktionary-20200704_v1.json" # ENGLISH
dicFileEn = "../wikiphon/dico_enWikiCmu.json"
logFile = "../logs/dico_frwiktionary-20200301_v2.log"
logFileEn = "../logs/dico_enWiktionary-20200704_v1.log" # ENGLISH
......
......@@ -16,6 +16,7 @@
--phon_1: #505050; /*ɨ*/
--phon_2: #c9004d; /*ø*/
--phon_3: #ef2d52; /*ɜ*/
--phon_3_rho: #ed727e; /*ɝ*/
--phon_3_slash: lightgray; /*ɞ 3\*/
--phon_3_long: #ef2d52; /*ɜ:*/
--phon_4: #c3ffff; /*ɾ*/
......@@ -113,6 +114,7 @@ svg {
.phon_1 { fill: var(--phon_1); color:var(--phon_1); stop-color:var(--phon_1);} /*ɨ*/
.phon_2 { fill: var(--phon_2); color:var(--phon_2); stop-color:var(--phon_2);} /*ø*/
.phon_3 { fill: var(--phon_3); color:var(--phon_3); stop-color:var(--phon_3);} /*ɜ*/
.phon_3_rho { fill: var(--phon_3_rho); color:var(--phon_3_rho); stop-color:var(--phon_3_rho);} /*ɝ*/
.phon_3_slash { fill: var(--phon_3_slash); color:var(--phon_3_slash); stop-color:var(--phon_3_slash);} /*ɞ 3\*/
.phon_3_long { fill: var(--phon_3); color:var(--phon_3); stop-color:var(--phon_3); text-decoration: underline var(--phon_3);} /*ɜ:*/
.phon_4 { fill: var(--phon_4); color:var(--phon_4); stop-color:var(--phon_4);} /*ɾ*/
......
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