Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -42,10 +42,13 @@ } this.aAllSugg.add(sSugg); if (!this.aSugg.has(sSugg)) { let nDist = str_transform.distanceDamerauLevenshtein(this.sSimplifiedWord, char_player.simplifyWord(sSugg)); if (nDist <= this.nDistLimit) { + if (sSugg.includes(" ")) { // add 1 to distance for split suggestions + nDist += 1; + } if (!this.dSugg.has(nDist)) { this.dSugg.set(nDist, []); } this.dSugg.get(nDist).push(sSugg); this.aSugg.add(sSugg); Index: graphspell/ibdawg.py ================================================================== --- graphspell/ibdawg.py +++ graphspell/ibdawg.py @@ -55,10 +55,12 @@ return self.aAllSugg.add(sSugg) if sSugg not in self.aSugg: nDist = st.distanceDamerauLevenshtein(self.sSimplifiedWord, cp.simplifyWord(sSugg)) if nDist <= self.nDistLimit: + if " " in sSugg: + nDist += 1 if nDist not in self.dSugg: self.dSugg[nDist] = [] self.dSugg[nDist].append(sSugg) self.aSugg.add(sSugg) if nDist < self.nMinDist: