我得到了包含多种语言文件的PyEnchant:en_US, en_AU, de_DE, fr_FR。现在我调用字典列表,只看到一小部分:'en', 'en_US', 'en_GB', 'en_CA'。我打电话给:
items = enchant._broker.list_languages()如何装入附魔的其他语言?新文件?这样enchant.Dict()就可以接受了。
发布于 2016-03-03 04:54:03
您可以在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
https://stackoverflow.com/questions/35757407
复制相似问题