没有德语字典的PyEnchant

Jey*_*Jey 4 python dictionary pyenchant

感谢Stackoverflow,我了解了pyenchant库。

我正在寻找通过附魔使用的德语词典“ de_DE”,但找不到。我在哪里可以得到它,应该将它放在哪个目录中以便pyenchant可以看到它?

我正在使用运行Ubuntu的Linux机器。

Dan*_*Dev 5

从终端输入:

sudo apt-get install myspell-de-de
Run Code Online (Sandbox Code Playgroud)

您可以从Python提示符下检查是否可用:

import enchant
print enchant.list_languages()
Run Code Online (Sandbox Code Playgroud)

要检查它是否有效,请从Python提示符下键入:

import enchant
d = enchant.Dict('de_DE')
d.check("Hello") # False
d.check("Guten") # True
Run Code Online (Sandbox Code Playgroud)

有关字典的完整列表,请参见:

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