Index: gc_core/js/ibdawg.js ================================================================== --- gc_core/js/ibdawg.js +++ gc_core/js/ibdawg.js @@ -286,13 +286,21 @@ oSuggResult.addSugg(sNewWord+sTail); } return; } let cCurrent = sRemain.slice(0, 1); - for (let [cChar, jAddr] of this._getSimilarCharArcs(cCurrent, iAddr)) { + for (let [cChar, jAddr] of this._getCharArcs(iAddr)) { + if (char_player.d1to1.gl_get(cCurrent, [cCurrent]).includes(cChar)) { + this._suggest(oSuggResult, sRemain.slice(1), nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, jAddr, sNewWord+cChar); + } + else if (!bAvoidLoop && nMaxHardRepl) { + this._suggest(oSuggResult, sRemain.slice(1), nMaxSwitch, nMaxDel, nMaxHardRepl-1, nDeep+1, jAddr, sNewWord+cChar, true); + } + } + /*for (let [cChar, jAddr] of this._getSimilarCharArcs(cCurrent, iAddr)) { this._suggest(oSuggResult, sRemain.slice(1), nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, jAddr, sNewWord+cChar); - } + }*/ if (!bAvoidLoop) { // avoid infinite loop if (sRemain.length > 1) { if (cCurrent == sRemain.slice(1, 2)) { // same char, we remove 1 char without adding 1 to this._suggest(oSuggResult, sRemain.slice(1), nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, iAddr, sNewWord); @@ -313,17 +321,17 @@ } for (let sRepl of char_player.d2toX.gl_get(sRemain.slice(0, 2), [])) { this._suggest(oSuggResult, sRepl + sRemain.slice(2), nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, iAddr, sNewWord, true); } // Hard replacements - if (nDeep > 3 && nMaxHardRepl && sRemain.length >= 2) { + /*if (nDeep > 3 && nMaxHardRepl && sRemain.length >= 2) { for (let [cChar, kAddr] of this._getCharArcs(iAddr)) { - if (!char_player.d1to1.gl_get(cCurrent, "").includes(cChar)) { + if (!char_player.d1to1.gl_get(cCurrent, [cCurrent]).includes(cChar)) { this._suggest(oSuggResult, sRemain.slice(1), nMaxSwitch, nMaxDel, nMaxHardRepl-1, nDeep+1, kAddr, sNewWord+cChar, true); } } - } + }*/ } // end of word if (sRemain.length == 2) { for (let sRepl of char_player.dFinal2.gl_get(sRemain, [])) { this._suggest(oSuggResult, sRepl, nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, iAddr, sNewWord, true); Index: gc_core/py/ibdawg.py ================================================================== --- gc_core/py/ibdawg.py +++ gc_core/py/ibdawg.py @@ -274,12 +274,17 @@ oSuggResult.addSugg(sNewWord, nDeep) for sTail in self._getTails(iAddr): oSuggResult.addSugg(sNewWord+sTail, nDeep) return cCurrent = sRemain[0:1] - for cChar, jAddr in self._getSimilarCharArcs(cCurrent, iAddr): - self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, jAddr, sNewWord+cChar, "*") + for cChar, jAddr in self._getCharArcs(iAddr): + if cChar in cp.d1to1.get(cCurrent, cCurrent): + self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, jAddr, sNewWord+cChar, "*") + elif not bAvoidLoop and nMaxHardRepl: + self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl-1, nDeep+1, jAddr, sNewWord+cChar, "[["+cChar+"]]", True) + #for cChar, jAddr in self._getSimilarCharArcs(cCurrent, iAddr): + # self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, jAddr, sNewWord+cChar, "*") if not bAvoidLoop: # avoid infinite loop if len(sRemain) > 1: if cCurrent == sRemain[1:2]: # same char, we remove 1 char without adding 1 to self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, iAddr, sNewWord, cCurrent+"/2") @@ -294,14 +299,14 @@ for sRepl in cp.get1toXReplacement(sNewWord[-1:], cCurrent, sRemain[1:2]): self._suggest(oSuggResult, sRepl + sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, iAddr, sNewWord, cCurrent+">"+sRepl, True) for sRepl in cp.d2toX.get(sRemain[0:2], ()): self._suggest(oSuggResult, sRepl + sRemain[2:], nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, iAddr, sNewWord, sRemain[0:2]+">"+sRepl, True) # Hard replacements - if nDeep > 3 and nMaxHardRepl: - for cChar, kAddr in self._getCharArcs(iAddr): - if cChar not in cp.d1to1.get(cCurrent, ""): - self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl-1, nDeep+1, kAddr, sNewWord+cChar, "[["+cChar+"]]", True) + #if nDeep > 3 and nMaxHardRepl: + # for cChar, kAddr in self._getCharArcs(iAddr): + # if cChar not in cp.d1to1.get(cCurrent, ""): + # self._suggest(oSuggResult, sRemain[1:], nMaxSwitch, nMaxDel, nMaxHardRepl-1, nDeep+1, kAddr, sNewWord+cChar, "[["+cChar+"]]", True) # end of word if len(sRemain) == 2: for sRepl in cp.dFinal2.get(sRemain, ()): self._suggest(oSuggResult, sRepl, nMaxSwitch, nMaxDel, nMaxHardRepl, nDeep+1, iAddr, sNewWord, sRemain + " >> " + sRepl, True) elif len(sRemain) == 1: Index: gc_lang/fr/config.ini ================================================================== --- gc_lang/fr/config.ini +++ gc_lang/fr/config.ini @@ -31,11 +31,11 @@ # Firefox fx_identifier = French-GC@grammalecte.net fx_name = Grammalecte [fr] win_fx_dev_path = C:\Program Files\Firefox Developer Edition\firefox.exe -win_fx_nightly_path = C:\Program Files (x86)\Nightly\firefox.exe +win_fx_nightly_path = C:\Program Files\Nightly\firefox.exe linux_fx_dev_path = /usr/bin/firefox linux_fx_nightly_path = /usr/bin/firefox # Thunderbird