Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -68,16 +68,17 @@ if (lRes.length > nSuggLimit) { break; } } lRes = char_player.filterSugg(lRes); - if (this.sWord.gl_isTitle()) { - lRes = lRes.map((sSugg) => { return sSugg.gl_toCapitalize(); }); - } - else if (this.sWord.gl_isUpperCase()) { + if (this.sWord.gl_isUpperCase()) { lRes = lRes.map((sSugg) => { return sSugg.toUpperCase(); }); } + else if (this.sWord.slice(0,1).gl_isUpperCase()) { + lRes = lRes.map((sSugg) => { return sSugg.slice(0, 1).toUpperCase() + sSugg.slice(1); }); + } + return lRes.slice(0, nSuggLimit); } reset () { this.aSugg.clear(); Index: graphspell/ibdawg.py ================================================================== --- graphspell/ibdawg.py +++ graphspell/ibdawg.py @@ -67,14 +67,14 @@ for lSugg in self.dSugg.values(): lRes.extend(lSugg) if len(lRes) > nSuggLimit: break lRes = list(cp.filterSugg(lRes)) - if self.sWord.istitle(): - lRes = list(map(lambda sSugg: sSugg.title(), lRes)) - elif self.sWord.isupper(): + if self.sWord.isupper(): lRes = list(map(lambda sSugg: sSugg.upper(), lRes)) + elif self.sWord[0:1].isupper(): + lRes = list(map(lambda sSugg: sSugg[0:1].upper()+sSugg[1:], lRes)) # dont’ use <.istitle> return lRes[:nSuggLimit] def reset (self): self.aSugg.clear() self.dSugg.clear()