def suggest(self,word): """Suggest possible spellings for a word. This method tries to guess the correct spelling for a given word, returning the possibilities in a list. """ self._check_this() word = EnchantStr(word) suggs = _e.dict_suggest(self._this,word.encode()) return [word.decode(w) for w in suggs]
def suggest(self, word): """Suggest possible spellings for a word. This method tries to guess the correct spelling for a given word, returning the possibilities in a list. """ self._check_this() word = EnchantStr(word) suggs = _e.dict_suggest(self._this, word.encode()) return [word.decode(w) for w in suggs]
def suggest(self, word): """Suggest possible spellings for a word. This method tries to guess the correct spelling for a given word, returning the possibilities in a list. """ self._check_this() # Enchant asserts that the word is non-empty. # Check it up-front to avoid nasty warnings on stderr. if len(word) == 0: raise ValueError("can't suggest spellings for empty string") suggs = _e.dict_suggest(self._this, word.encode()) return [w.decode() for w in suggs]
def suggest(self,word): """Suggest possible spellings for a word. This method tries to guess the correct spelling for a given word, returning the possibilities in a list. """ self._check_this() word = EnchantStr(word) # Enchant asserts that the word is non-empty. # Check it up-front to avoid nasty warnings on stderr. if len(word) == 0: raise ValueError("can't suggest spellings for empty string") suggs = _e.dict_suggest(self._this,word.encode()) return [word.decode(w) for w in suggs]