Commit 86e17443 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

mise à jour en:Region, traduction dico ; custom couleur en cours (désactivé)

parent 97bed1e3
......@@ -81,17 +81,25 @@ def getLenDic(lang):
##### MISE EN MÉMOIRE DES DICTIONNAIRES (seulement les transcriptions+regions)
def makeWord2trans(alemDic):
query = alemDic.find()
query = alemDic.find()#.limit(1000)
word2trans = {}
cpt = 0
for q in query:
if len(q['w'].split(' '))==1:
# on met que les mots simples en mémoire (pas les expressions (=avec une espace))
if q['w'] not in word2trans.keys():
cpt+=1
word2trans[q['w']] = { "t" : q['t'] } # pas besoin de mettre en mémoire le reste pour l'instant (catégories, traductions, fantizi...)
print("Mise en mémoire...",cpt,end='\r',flush=True)
else:
print('DOUBLON DÉTECTÉ :', q['w'])
return word2trans
word2transFr = {}
word2transEn = {}
word2transZh = {}
print("Mise en mémoire de dicoFr...")
word2transFr = makeWord2trans(dicoFr)
print("Nombre d'entrées dans AlemDic-dicoFr :", getLenDic('fr'))
......@@ -100,10 +108,9 @@ print("Mise en mémoire de dicoEn...")
word2transEn = makeWord2trans(dicoEn)
print("Nombre d'entrées dans AlemDic-dicoEn :", getLenDic(('en')))
print("Mise en mémoire de dicoZh...")
word2transZh = makeWord2trans(dicoZh)
print("Nombre d'entrées dans AlemDic-dicoZh :", getLenDic('zh'))
# print("Mise en mémoire de dicoZh...")
# word2transZh = makeWord2trans(dicoZh)
# print("Nombre d'entrées dans AlemDic-dicoZh :", getLenDic('zh'))
########################################
######### LECTURE DES FICHIERS #########
......@@ -340,16 +347,16 @@ def getEntryByWord(m,mc,t,tc,lang):
mc1 = r'.*'
mc2 = r'.*'
if mc == 'commence par' or mc == 'est égal à':
if mc == 'startsBy' or mc == 'equalsTo':
mc1 = r'^'
if mc == 'finit par' or mc == 'est égal à':
if mc == 'endsBy' or mc == 'equalsTo':
mc2 = r'$'
tc1 = r'.*'
tc2 = r'.*'
if tc == 'commence par' or tc == 'est égal à':
if tc == 'startsBy' or tc == 'equalsTo':
tc1 = r'^'
if tc == 'finit par' or tc == 'est égal à':
if tc == 'endsBy' or tc == 'equalsTo':
tc2 = r'$'
# for entree, infos in word2trans.items():
......
......@@ -120,7 +120,6 @@ var langJson = {
"en": "Access WikiColor's tutorials",
"zh": "访问教程"
},
"sp_copypasteH2": {
"fr": "Copier/coller le résultat",
"en": "Copy/Paste the output",
......@@ -174,7 +173,7 @@ var langJson = {
"sp_popAddwTrans": {
"fr": "Transcription phonétique (API) :",
"en": "Phonetic transcription (IPA):",
"zh": "Phonetic transcription (Pinyin, ex. ni2 hao3):"
"zh": "Pinyin (ex. ni2 hao3):"
},
"sp_popAddwInfo": {
"fr": "(Vous pouvez saisir plusieurs transcriptions différentes en les séparant par une virgule)",
......@@ -210,5 +209,235 @@ var langJson = {
"fr": "Retour au coloriseur",
"en": "Back to the coloriser",
"zh": "Back to the coloriser"
},
"sp_dicoH2": {
"fr": "Rechercher une entrée du dictionnaire français",
"en": "Search words in the English dictionary",
"zh": "中文詞典中搜索詞語"
},
"sp_dicoContient": {
"fr": "contient",
"en": "includes",
"zh": "includes"
},
"sp_dicoComm": {
"fr": "commence par",
"en": "starts by",
"zh": "starts by"
},
"sp_dicoFini": {
"fr": "finit par",
"en": "ends by",
"zh": "ends by"
},
"sp_dicoEgal": {
"fr": "est égal à",
"en": "is equal to",
"zh": "is equal to"
},
"sp_dicoContient2": {
"fr": "contient",
"en": "includes",
"zh": "includes"
},
"sp_dicoComm2": {
"fr": "commence par",
"en": "starts by",
"zh": "starts by"
},
"sp_dicoFini2": {
"fr": "finit par",
"en": "ends by",
"zh": "ends by"
},
"sp_dicoEgal2": {
"fr": "est égal à",
"en": "is equal to",
"zh": "is equal to"
},
"sp_dicoRechercher": {
"fr": "Rechercher",
"en": "Search",
"zh": "Search"
},
"rechercher": {
"fr": "Rechercher dans le dictionnaire",
"en": "Look up this word and/or this transcription in the dictionary",
"zh": "Look up this word and/or this transcription in the dictionary"
},
"sp_dicoInfoEntry": {
"fr": "Nombre actuel d'entrées du dictionnaire",
"en": "Current number of entries in the dictionary",
"zh": "Current number of entries in the dictionary"
},
"sp_dicoInfoMod": {
"fr": "modifications enregistrées par les utilisateurs",
"en": "changes made by users",
"zh": "changes made by users"
},
"sp_dicoInfoModAdd": {
"fr": "ajouts",
"en": "additions",
"zh": "additions"
},
"sp_dicoInfoModEd": {
"fr": "éditions",
"en": "editings",
"zh": "editings"
},
"sp_dicoInfoModDel": {
"fr": "suppressions",
"en": "removals",
"zh": "removals"
},
"sp_dicoInfoHist": {
"fr": "Voir l'historique complet des modifications du dictionnaire",
"en": "Access to complete records of changes",
"zh": "Access to complete records of changes"
},
"sp_dicoResultats": {
"fr": "Résultats de la recherche",
"en": "Search results",
"zh": "Search results"
},
"sp_dicoMot": {
"fr": "Mot :",
"en": "Word:",
"zh": "Word:"
},
"sp_dicoTrans": {
"fr": "Transcription phonétique (API) :",
"en": "Phonetic transcription (IPA):",
"zh": "Pinyin (ex. ni2 hao3):"
},
"sp_dicoMot2": {
"fr": "Mot :",
"en": "Word:",
"zh": "Word:"
},
"sp_dicoTrans2": {
"fr": "Transcription phonétique (API) :",
"en": "Phonetic transcription (IPA):",
"zh": "Pinyin (ex. ni2 hao3):"
},
"sp_dicoActions": {
"fr": "Actions",
"en": "Actions",
"zh": "Actions"
},
"btnShowMore": {
"fr": "afficher plus de résultats",
"en": "show more results",
"zh": "show more results"
},
"sp_dicoAddNewWord": {
"fr": "Ajouter une nouvelle entrée dans le dictionnaire",
"en": "Add a new entry to WikiColor dictionary",
"zh": "Add a new entry to WikiColor dictionary"
},
"sp_dicoAddNewWordAdd": {
"fr": "Ajouter",
"en": "Add",
"zh": "Add"
},
"ti_addNewWord": {
"fr": "Ajouter cette entrée dans le dictionnaire",
"en": "Add this new entry to WikiColor dictionary",
"zh": "Add this new entry to WikiColor dictionary"
},
"sp_dicoBackDico": {
"fr": "Retour aux dictionnaires",
"en": "Back to the dictionaries",
"zh": "Back to the dictionaries"
},
"sp_dicoBackCol": {
"fr": "Retour au coloriseur",
"en": "Back to the coloriser",
"zh": "Back to the coloriser"
},
"sp_dicoHisto": {
"fr": "Historique des modifications",
"en": "Record of changes",
"zh": "Record of changes"
},
"sp_dicoEditEntry": {
"fr": "Modifier une entrée du dictionnaire",
"en": "Edit an entry of the dictionary",
"zh": "Edit an entry of the dictionary"
},
"sp_dicoEditEntryAdd": {
"fr": "Ajouter une prononciation",
"en": "Add a pronunciation",
"zh": "Add a pronunciation"
},
"sp_dicoEditEntryWord": {
"fr": "Mot :",
"en": "Word:",
"zh": "Word:"
},
"sp_dicoEditEntryPOS": {
"fr": "Traits morphosyntaxiques :",
"en": "Part of speech:",
"zh": "Part of speech:"
},
"sp_dicoEditEntryMeaning": {
"fr": "Meaning",
"en": "Meaning",
"zh": "Meaning"
},
"sp_dicoEditEntryTrans": {
"fr": "Transcription (API)",
"en": "Transcription (IPA)",
"zh": "Transcription (Pinyin)"
},
"sp_dicoEditEntryReg": {
"fr": "Région(s)/Variété",
"en": "Region(s)/Variety",
"zh": "Region(s)/Variety"
},
"sp_dicoEditRegTitle": {
"fr": "Sélectionnez une ou plusieurs régions pour cette prononciation",
"en": "Select one or more regions for this pronunciation",
"zh": "Select one or more regions for this pronunciation"
},
"sp_dicoEditRegW": {
"fr": "Mot :",
"en": "Word:",
"zh": "Word:"
},
"sp_dicoEditRegP": {
"fr": "Prononciation",
"en": "Pronunciation",
"zh": "Pronunciation"
},
"sp_dicoEditRegC": {
"fr": "Commentaire :",
"en": "Comment:",
"zh": "Comment:"
},
"modalEditWordRegionComment": {
"fr": "Vous pouvez commenter cette prononciation.",
"en": "Type any comment you want on this pronunciation.",
"zh": "Type any comment you want on this pronunciation."
},
"sp_dicoEditRegSave": {
"fr": "Enregistrer",
"en": "Save",
"zh": "Save"
},
"ti_btnCustom": {
"fr": "Personnaliser la colorisation",
"en": "Customise the output",
"zh": "Customise the output"
},
"sp_customExplain": {
"fr": "Choisissez les phonèmes à coloriser et leur couleur",
"en": "Choisissez les phonèmes à coloriser et leur couleur",
"zh": "Choisissez les phonèmes à coloriser et leur couleur"
},
"sp_customColBase": {
"fr": "Couleur de base :",
"en": "Base color:",
"zh": "Base color:"
}
}
\ No newline at end of file
let api2class = {
"ɨ":"phon_1",
"ø":"phon_2",
"ɜ":"phon_3",
"ɞ":"phon_3_slash",
"ɜː":"phon_3_long",
"ɝ":"phon_3_rho",
"ɾ":"phon_4",
"ɫ":"phon_5",
"":"phon_5",
"ɐ":"phon_6",
"ɤ":"phon_7",
"ɵ":"phon_8",
"œ":"phon_9",
"ɶ":"phon_9_maj",
"œ̃":"phon_9_nas",
"a":"phon_a",
"ä":"phon_a_centr",
"ɑ":"phon_a_maj",
"ɑː":"phon_a_maj_long",
"ɑ̃":"phon_a_maj_nas",
"ə":"phon_arobase",
"ɚ":"phon_arobase_rho",
"":"phon_arho",
"ɤ˞":"phon_7rho",
"ɘ":"phon_arobase_slash",
"b":"phon_b",
"ɓ":"phon_b_chev",
"β":"phon_b_maj",
"ʙ":"phon_b_maj_slash",
"c":"phon_c",
"ç":"phon_c_maj",
"æ":"phon_cbrack",
"ʉ":"phon_cbrack2",
"ʢ":"phon_chevron_slash",
"ʡ":"phon_chevron2_slash",
"d":"phon_d",
"ɗ":"phon_d_chev",
"ð":"phon_d_maj",
"ɖ":"phon_d_retr",
"e":"phon_e",
"ɛ":"phon_e_maj",
"ɛ̃":"phon_e_maj_nas",
"ǂ":"phon_egal_slash",
"ǃ":"phon_exclam_slash",
"f":"phon_f",
"ɱ":"phon_f_maj",
"ɡ":"phon_g",
"ɠ":"phon_g_chev",
"ɣ":"phon_g_maj",
"ɢ":"phon_g_maj_slash",
"ʛ":"phon_g_maj_slash_chev",
"ʔ":"phon_glottstop",
"ʕ":"phon_glottstop_slash",
"h":"phon_h",
"ɥ":"phon_h_maj",
"ʜ":"phon_h_maj_slash",
"ɦ":"phon_h_slash",
"i":"phon_i",
"":"phon_i_long",
"ɪ":"phon_i_maj",
"j":"phon_j",
"ʝ":"phon_j_slash",
"ɟ":"phon_j_maj_slash",
"ʄ":"phon_j_maj_slash_chev",
"k":"phon_k",
"":"phon_k_chev2",
"":"phon_k_h",
"ɬ":"phon_k_maj",
"ɮ":"phon_k_maj_slash",
"l":"phon_l",
"ʎ":"phon_l_maj",
"ʟ":"phon_l_maj_slash",
"ɭ":"phon_l_retr",
"m":"phon_m",
"ɯ":"phon_m_maj",
"ɰ":"phon_m_maj_slash",
"n":"phon_n",
"ŋ":"phon_n_maj",
"ɴ":"phon_n_maj_slash",
"ɳ":"phon_n_retr",
"o":"phon_o",
"ɔ":"phon_o_maj",
"ɔː":"phon_o_maj_long",
"ɔ̃":"phon_o_maj_nas",
"ʘ":"phon_o_maj_slash",
"p":"phon_p",
"":"phon_p_chev2",
"":"phon_p_d",
"":"phon_p_h",
"ʋ":"phon_p_maj",
"ɸ":"phon_p_slash",
"ǀ":"phon_pipe_slash",
"ǁ":"phon_pipe_slashpipe_slash",
"q":"phon_q",
"":"phon_q_chev2",
"ɒ":"phon_q_maj",
"r":"phon_r",
"":"phon_r_0",
"ʁ":"phon_r_maj",
"ʀ":"phon_r_maj_slash",
"ɽ":"phon_r_retr",
"ɹ":"phon_r_slash",
"ɻ":"phon_r_slash_retr",
"s":"phon_s",
"":"phon_s_chev2",
"ʃ":"phon_s_maj",
"ʃʼ":"phon_s_maj_chev2",
"ʂ":"phon_s_retr",
"ɕ":"phon_s_slash",
"t":"phon_t",
"":"phon_t_chev2",
"":"phon_t_h",
"θ":"phon_t_maj",
"ʈ":"phon_t_retr",
"ʈʼ":"phon_t_retr_chev2",
"u":"phon_u",
"":"phon_u_long",
"ʊ":"phon_u_maj",
"v":"phon_v",
"":"phon_v_flap",
"ʌ":"phon_v_maj",
"w":"phon_w",
"ʍ":"phon_w_maj",
"x":"phon_x",
"":"phon_x_chev2",
"χ":"phon_x_maj",
"ħ":"phon_x_maj_slash",
"ɧ":"phon_x_slash",
"y":"phon_y",
"ʏ":"phon_y_maj",
"z":"phon_z",
"ʒ":"phon_z_maj",
"ʐ":"phon_z_retr",
"ʑ":"phon_z_slash",
"pour l'anglais i/ɪ":"phon_schwi",
"pour l'anglais ə":"phon_schwa",
"pour l'anglais u/ʊ":"phon_schwu",
"ɑɹ":"phon_a_majr",
"":"phon_ai_maj",
"aɪə":"phon_ai_majarobase",
"":"phon_au_maj",
"aʊwə":"phon_au_majwarobase",
"əl":"phon_arobasel",
"əm":"phon_arobasem",
"ən":"phon_arobasen",
"əʊ":"phon_arobaseu_maj",
"d͡z":"phon_dz",
"dz":"phon_dz",
"d͡ʒ":"phon_dz_maj",
"":"phon_dz_maj",
"d͡ʐ":"phon_dz_retr",
"":"phon_dz_retr",
"d͡ʑ":"phon_dz_slash",
"":"phon_dz_slash",
"ef":"phon_ef",
"":"phon_ei_maj",
"":"phon_earobase",
"":"phon_er",
"ɪə":"phon_i_majarobase",
"jʊə":"phon_ju_majarobase",
"ɡ͡b":"phon_gb",
"ɡb":"phon_gb",
"ɡz":"phon_gz",
"ɡʒ":"phon_gz_maj",
"ɥi":"phon_h_maj_i",
"ij":"phon_ij",
"ɪɹ":"phon_i_majr",
"ɲ":"phon_j_maj",
"":"phon_jarobase",
"juː":"phon_ju_long",
"jʊɹ":"phon_ju_majr",
"k͡p":"phon_kp",
"kp":"phon_kp",
"k͡s":"phon_ks",
"ks":"phon_ks",
"":"phon_ks_maj",
"k͡x":"phon_kx",
"kx":"phon_kx",
"":"phon_kw",
"kw":"phon_kw",
"lj":"phon_lj",
"nj":"phon_nj",
"":"phon_ou_maj",
"ɔɪ":"phon_o_maji_maj",
"ɔɹ":"phon_o_majr",
"p͡f":"phon_pf",
"pf":"phon_pf",
"sz":"phon_sz",
"t͡sʰ":"phon_t_hs",
"tsʰ":"phon_t_hs",
"t͡ʂʰ":"phon_t_hs_retr",
"tʂʰ":"phon_t_hs_retr",
"t͡ɕʰ":"phon_t_hs_slash",
"tɕʰ":"phon_t_hs_slash",
"t͡ɬ":"phon_tk_maj",
"":"phon_tk_maj",
"d͡ɮ":"phon_tk_maj_slash",
"":"phon_tk_maj_slash",
"t͡s":"phon_ts",
"ts":"phon_ts",
"t͡sʼ":"phon_ts_chev2",
"tsʼ":"phon_ts_chev2",
"t͡ʃ":"phon_ts_maj",
"":"phon_ts_maj",
"t͡ʃʼ":"phon_ts_maj_chev2",
"tʃʼ":"phon_ts_maj_chev2",
"t͡ʂ":"phon_ts_retr",
"":"phon_ts_retr",
"t͡ɕ":"phon_ts_slash",
"":"phon_ts_slash",
"t͡θ":"phon_tt_maj",
"":"phon_tt_maj",
"ʊə":"phon_u_majarobase",
"ʊɹ":"phon_u_majr",
"wa":"phon_wa",
"waɹ":"phon_war",
"":"phon_wa_maj",
"wɑː":"phon_wa_maj_long",
"waɪ":"phon_wai_maj",
"wɛ̃":"phon_we_maj_nas",
"":"phon_wv_maj",
"ju/jʊ":"phon_schwju",
"iz/ɪz":"phon_schwiz",
"əz":"phon_schwaz",
"m͡p":"phon_mp",
"m͡b":"phon_mb",
"n͡t̪":"phon_nt_d",
"n͡d̪":"phon_nd_d",
"n͡t":"phon_nt",
"n͡d":"phon_nd",
"ɳ͡ʈ":"phon_n_retrt",
"ɳ͡ɖ":"phon_n_retrd_retr",
"ɲ͡c":"phon_j_majc",
"ɲ͡ɟ":"phon_j_majj_maj_slash",
"ŋ͡k":"phon_n_majk",
"ŋ͡ɡ":"phon_n_majg",
"ɴ͡q":"phon_n_maj_slashq",
"ɴ͡ɢ":"phon_n_maj_slashg_maj_slash",
"ŋ͡m":"phon_n_majm",
"p͡ɸ":"phon_pp_slash",
"b͡β":"phon_bb_maj",
"b͡v":"phon_bv",
"d͡ð":"phon_dd_maj",
"ʈ͡ʂ":"phon_t_slashs_retr",
"ɖ͡ʐ":"phon_d_slashz_retr",
"c͡ç":"phon_cc_maj",
"ɟ͡ʝ":"phon_j_maj_slashj_slash",
"ɡ͡ɣ":"phon_gg_maj",
"q͡χ":"phon_qx_maj",
"ɢ͡ʁ":"phon_g_maj_slashr_maj",
"ʔ͡h":"phon_glottstoph",
"m͡ɸ":"phon_mp_slash",
"m͡β":"phon_mb_maj",
"n͡θ":"phon_nt_maj",
"n͡ð":"phon_nd_maj",
"n͡s":"phon_ns",
"n͡z":"phon_nz",
"n͡ʃ":"phon_ns_maj",
"n͡ʒ":"phon_nz_maj",
"mp":"phon_mp",
"mb":"phon_mb",
"nt̪":"phon_nt_d",
"nd̪":"phon_nd_d",
"nt":"phon_nt",
"nd":"phon_nd",
"ɳʈ":"phon_n_retrt",
"ɳɖ":"phon_n_retrd_retr",
"ɲc":"phon_j_majc",
"ɲɟ":"phon_j_majj_maj_slash",
"ŋk":"phon_n_majk",
"ŋɡ":"phon_n_majg",
"ɴq":"phon_n_maj_slashq",
"ɴɢ":"phon_n_maj_slashg_maj_slash",