@@ -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);