2024-06-13 18:24:04 发布
网友
我有两个hunspell格式的文件(.dic和.aff)乌克兰语。我的程序必须得到输入字的基本形式。因此,它可以使用.dic文件中的单词形式和.aff文件中的词缀。即使使用hunspellutil我也不知道如何实现这一点,但是假设这是可能的。在
哪些python库可以使用.dic和.aff文件获取单词的基本形式?在
如前所述,hunspell是你需要的图书馆。 来自https://code.google.com/p/pyhunspell/wiki/UsingPyHunspell的示例:
import hunspell hobj = hunspell.HunSpell('/usr/share/myspell/en_US.dic', '/usr/share/myspell/en_US.aff') hobj.spell('spookie') >>>>False hobj.suggest('spookie') >>>>['spookier', 'spookiness', 'spooky', 'spook', 'spoonbill'] hobj.spell('spooky') >>>>True hobj.analyze('linked') >>>>[' st:link fl:D'] hobj.stem('linked') >>>>['link']
只是一个更新,说乐pyhunspell项目不再在googlecode上了。 以下是新链接:
至于add函数(在first answer的注释中提到),它现在被记录在pydoc中。在
如前所述,hunspell是你需要的图书馆。 来自https://code.google.com/p/pyhunspell/wiki/UsingPyHunspell的示例:
只是一个更新,说乐pyhunspell项目不再在googlecode上了。 以下是新链接:
至于add函数(在first answer的注释中提到),它现在被记录在pydoc中。在
相关问题 更多 >
编程相关推荐