Index: graphspell/spellchecker.py ================================================================== --- graphspell/spellchecker.py +++ graphspell/spellchecker.py @@ -224,12 +224,18 @@ return self._dLemmas[sWord] return set([ s[1:s.find(" ")] for s in self.getMorph(sWord) ]) def suggest (self, sWord, nSuggLimit=10): "generator: returns 1, 2 or 3 lists of suggestions" - if self.dDefaultSugg and sWord in self.dDefaultSugg: - yield self.dDefaultSugg[sWord].split("|") + if self.dDefaultSugg: + if sWord in self.dDefaultSugg: + yield self.dDefaultSugg[sWord].split("|") + elif sWord.istitle() and sWord.lower() in self.dDefaultSugg: + lRes = self.dDefaultSugg[sWord.lower()].split("|") + yield list(map(lambda sSugg: sSugg[0:1].upper()+sSugg[1:], lRes)) + else: + yield self.oMainDic.suggest(sWord, nSuggLimit) else: yield self.oMainDic.suggest(sWord, nSuggLimit) if self.bExtendedDic: yield self.oExtendedDic.suggest(sWord, nSuggLimit) if self.bCommunityDic: