def cb_func(tag,name,desc,file): s = EnchantStr("") tag = s.decode(tag) name = s.decode(name) desc = s.decode(desc) file = s.decode(file) cb_result.append((tag,name,desc,file))
def __describe_callback(self,name,desc,file): """Collector callback for dictionary description. This method is used as a callback into the _enchant function 'enchant_broker_describe'. It collects the given arguments in a tuple and appends them to the list '__describe_result'. """ s = EnchantStr("") name = s.decode(name) desc = s.decode(desc) file = s.decode(file) self.__describe_result.append((name,desc,file))
def __describe_callback(self,tag,name,desc,file): """Collector callback for dictionary description. This method is used as a callback into the _enchant function 'enchant_dict_describe'. It collects the given arguments in a tuple and stores them in the attribute '__describe_result'. """ s = EnchantStr("") tag = s.decode(tag) name = s.decode(name) desc = s.decode(desc) file = s.decode(file) self.__describe_result = (tag,name,desc,file)
def __list_dicts_callback(self,tag,name,desc,file): """Collector callback for listing dictionaries. This method is used as a callback into the _enchant function 'enchant_broker_list_dicts'. It collects the given arguments into an appropriate tuple and appends them to '__list_dicts_result'. """ s = EnchantStr("") tag = s.decode(tag) name = s.decode(name) desc = s.decode(desc) file = s.decode(file) self.__list_dicts_result.append((tag,(name,desc,file)))
def get_param(self,name): """Get the value of a named parameter on this broker. Parameters are used to provide runtime information to individual provider backends. See the method 'set_param' for more details. """ name = EnchantStr(name) return name.decode(_e.broker_get_param(self._this,name.encode()))
def get_param(self, name): """Get the value of a named parameter on this broker. Parameters are used to provide runtime information to individual provider backends. See the method 'set_param' for more details. """ name = EnchantStr(name) return name.decode(_e.broker_get_param(self._this, name.encode()))
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() 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]