Index: graphspell-js/dawg.js ================================================================== --- graphspell-js/dawg.js +++ graphspell-js/dawg.js @@ -78,10 +78,14 @@ lEntry.push([sFlex, dAff.get(sAff), dTag.get(sTag)]); } if (lEntry.length == 0) { throw "Error. Empty lexicon"; } + + lEntry = [...new Set(lEntry.map(e => JSON.stringify(e)))].map(s => JSON.parse(s)); + // Set can’t distinguish similar lists, so we transform list item in string given to the Set + // then we transform items in list a new. // Preparing DAWG console.log(" > Preparing list of words"); let lVal = lChar.concat(lAff).concat(lTag); let lWord = [];