Index: gc_lang/fr/config.ini ================================================================== --- gc_lang/fr/config.ini +++ gc_lang/fr/config.ini @@ -15,11 +15,11 @@ logo = logo.png # lexicon source lexicon_src = lexicons/French.lex # binary dictionary name -dic_name = French +dic_name = fr # Finite state automaton compression: 1, 2 (experimental) or 3 (experimental) fsa_method = 1 # stemming method: S for suffixes only, A for prefixes and suffixes stemming_method = S Index: gc_lang/fr/modules/tests.py ================================================================== --- gc_lang/fr/modules/tests.py +++ gc_lang/fr/modules/tests.py @@ -22,11 +22,11 @@ class TestDictionary (unittest.TestCase): @classmethod def setUpClass (cls): - cls.oDic = IBDAWG("French.bdic") + cls.oDic = IBDAWG("${dic_name}.bdic") def test_lookup (self): for sWord in ["branche", "Émilie"]: self.assertTrue(self.oDic.lookup(sWord), sWord) Index: make.py ================================================================== --- make.py +++ make.py @@ -222,11 +222,11 @@ if not os.path.isdir("gc_core/py/lang_core/"+sf): helpers.copyAndFileTemplate("gc_core/py/lang_core/"+sf, spLangPack+"/"+sf, dVars) print("+ Modules: ", end="") for sf in os.listdir(spLang+"/modules"): if not sf.startswith(("gce_", "__pycache__")): - file_util.copy_file(spLang+"/modules/"+sf, spLangPack) + helpers.copyAndFileTemplate(spLang+"/modules/"+sf, spLangPack+"/"+sf, dVars) print(sf, end=", ") print() # TEST FILES with open("grammalecte/"+sLang+"/gc_test.txt", "w", encoding="utf-8", newline="\n") as hDstPy: @@ -303,17 +303,18 @@ file_util.copy_file("graphspell-js/"+sf, "grammalecte-js/graphspell") helpers.copyAndFileTemplate("graphspell-js/"+sf, "grammalecte-js/graphspell/"+sf, dVars) def copyGraphspellDictionary (dVars, bJavaScript=False): - spfDic = "graphspell/_dictionaries/"+dVars['dic_name']+".bdic" - if not os.path.isfile(spfDic): + spfPyDic = "graphspell/_dictionaries/"+dVars['dic_name']+".bdic" + spfJSDic = "graphspell-js/_dictionaries/"+dVars['dic_name']+".json" + if not os.path.isfile(spfPyDic) or (bJavaScript and not os.path.isfile(spfJSDic)): buildDictionary(dVars, bJavaScript) - file_util.copy_file(spfDic, "grammalecte/graphspell/_dictionaries") - file_util.copy_file(spfDic[:-5]+".info.txt", "grammalecte/graphspell/_dictionaries") + file_util.copy_file(spfPyDic, "grammalecte/graphspell/_dictionaries") + file_util.copy_file(spfPyDic[:-5]+".info.txt", "grammalecte/graphspell/_dictionaries") if bJavaScript: - file_util.copy_file(spfDic[:-5]+".json", "grammalecte-js/graphspell/_dictionaries") + file_util.copy_file(spfJSDic, "grammalecte-js/graphspell/_dictionaries") def buildDictionary (dVars, bJavaScript): lex_build.build(dVars['lexicon_src'], dVars['lang_name'], dVars['dic_name'], bJavaScript, dVars['stemming_method'], int(dVars['fsa_method']))