2024-04-29 04:03:45 发布
网友
我得到了PyEnchant和许多语言的文件:en_US, en_AU, de_DE, fr_FR。现在我调用字典列表,只看到一个小集合:'en', 'en_US', 'en_GB', 'en_CA'。 我打电话给:
en_US, en_AU, de_DE, fr_FR
'en', 'en_US', 'en_GB', 'en_CA'
items = enchant._broker.list_languages()
如何加载到附魔其他兰格?新文件?所以enchant.Dict()可以接受。
enchant.Dict()
您可以通过Python提示类型检查是否有可用的语言:
import enchant print enchant.list_languages()
然后你需要进口它,让我们假设德语是我要找的。然后,从终端I输入:
sudo apt-get install myspell-de-de
要检查它是否有效,请从Python提示符键入:
import enchant d = enchant.Dict('de_DE') d.check("Hello") # False d.check("Guten") # True
有关词典的完整列表,请参见:
http://packages.ubuntu.com/precise/myspell-dictionary
http://packages.ubuntu.com/precise/aspell-dictionary
http://packages.ubuntu.com/source/precise/openoffice.org-dictionaries
http://packages.ubuntu.com/precise/ispell-dictionary
您可以通过Python提示类型检查是否有可用的语言:
然后你需要进口它,让我们假设德语是我要找的。然后,从终端I输入:
要检查它是否有效,请从Python提示符键入:
有关词典的完整列表,请参见:
http://packages.ubuntu.com/precise/myspell-dictionary
http://packages.ubuntu.com/precise/aspell-dictionary
http://packages.ubuntu.com/source/precise/openoffice.org-dictionaries
http://packages.ubuntu.com/precise/ispell-dictionary
相关问题 更多 >
编程相关推荐