Index: graphspell-js/char_player.js ================================================================== --- graphspell-js/char_player.js +++ graphspell-js/char_player.js @@ -30,15 +30,15 @@ ]), simplifyWord: function (sWord) { // word simplication before calculating distance between words sWord = sWord.toLowerCase(); - sWord = ([...sWord].map(c => this._xTransCharsForSimplification.gl_get(c, c))).join('') + sWord = [...sWord].map(c => this._xTransCharsForSimplification.gl_get(c, c)).join(''); let sNewWord = ""; let i = 1; for (let c of sWord) { - if (c != sWord.slice(i, i+1)) { + if (c == 'e' || c != sWord.slice(i, i+1)) { // exception for to avoid confusion between crée / créai sNewWord += c; } i++; } return sNewWord.replace(/eau/g, "o").replace(/au/g, "o").replace(/ai/g, "e").replace(/ei/g, "e").replace(/ph/g, "f"); Index: graphspell/char_player.py ================================================================== --- graphspell/char_player.py +++ graphspell/char_player.py @@ -27,11 +27,11 @@ def simplifyWord (sWord): "word simplication before calculating distance between words" sWord = sWord.lower().translate(_xTransCharsForSimplification) sNewWord = "" for i, c in enumerate(sWord, 1): - if c != sWord[i:i+1]: + if c == 'e' or c != sWord[i:i+1]: # exception for to avoid confusion between crée / créai sNewWord += c return sNewWord.replace("eau", "o").replace("au", "o").replace("ai", "e").replace("ei", "e").replace("ph", "f") aVowel = set("aáàâäāeéèêëēiíìîïīoóòôöōuúùûüūyýỳŷÿȳœæAÁÀÂÄĀEÉÈÊËĒIÍÌÎÏĪOÓÒÔÖŌUÚÙÛÜŪYÝỲŶŸȲŒÆ")