当前位置: 首页>>代码示例>>Python>>正文


Python EnchantStr.decode方法代码示例

本文整理汇总了Python中enchant.utils.EnchantStr.decode方法的典型用法代码示例。如果您正苦于以下问题:Python EnchantStr.decode方法的具体用法?Python EnchantStr.decode怎么用?Python EnchantStr.decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在enchant.utils.EnchantStr的用法示例。


在下文中一共展示了EnchantStr.decode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: cb_func

# 需要导入模块: from enchant.utils import EnchantStr [as 别名]
# 或者: from enchant.utils.EnchantStr import decode [as 别名]
 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))
开发者ID:DKaman,项目名称:pyenchant,代码行数:9,代码来源:__init__.py

示例2: __describe_callback

# 需要导入模块: from enchant.utils import EnchantStr [as 别名]
# 或者: from enchant.utils.EnchantStr import decode [as 别名]
 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))
开发者ID:DKaman,项目名称:pyenchant,代码行数:14,代码来源:__init__.py

示例3: __list_dicts_callback

# 需要导入模块: from enchant.utils import EnchantStr [as 别名]
# 或者: from enchant.utils.EnchantStr import decode [as 别名]
 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)))
开发者ID:DKaman,项目名称:pyenchant,代码行数:15,代码来源:__init__.py

示例4: get_param

# 需要导入模块: from enchant.utils import EnchantStr [as 别名]
# 或者: from enchant.utils.EnchantStr import decode [as 别名]
    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()))
开发者ID:DKaman,项目名称:pyenchant,代码行数:10,代码来源:__init__.py

示例5: suggest

# 需要导入模块: from enchant.utils import EnchantStr [as 别名]
# 或者: from enchant.utils.EnchantStr import decode [as 别名]
 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]
开发者ID:arkershaw,项目名称:pyenchant,代码行数:12,代码来源:__init__.py

示例6: suggest

# 需要导入模块: from enchant.utils import EnchantStr [as 别名]
# 或者: from enchant.utils.EnchantStr import decode [as 别名]
 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]
开发者ID:DKaman,项目名称:pyenchant,代码行数:16,代码来源:__init__.py


注:本文中的enchant.utils.EnchantStr.decode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。