问题描述
由于Stackoverflow,我了解了pyenchant库.
Thanks to Stackoverflow, I learnt about pyenchant library.
我正在寻找通过附魔使用的德语词典"de_DE",但找不到.我在哪里可以得到它,应该把它放在哪个目录下以便pyenchant可以看到它?
I am looking for German dictionary "de_DE" to use through enchant, but could not find one. Where can I get it and which directory should I put it so that pyenchant can see it?
我正在使用运行Ubuntu的Linux机器.
I am using a linux box running Ubuntu.
推荐答案
从终端输入:
sudo apt-get install myspell-de-de
您可以从Python提示符下检查是否可用:
You can check that you have it available, from a Python prompt type:
import enchant
print enchant.list_languages()
要检查其是否有效,请在Python提示符下输入:
To check it works, from a Python prompt type:
import enchant
d = enchant.Dict('de_DE')
d.check("Hello") # False
d.check("Guten") # True
有关词典的完整列表,请参见:
For a fuller list of dictionaries see:
http://packages.ubuntu.com/precise/myspell-dictionary
http://packages.ubuntu.com/precise/aspell-dictionary
http://packages.ubuntu.com/source/precise/openoffice.组织词典
http://packages.ubuntu.com/precise/ispell-dictionary
这篇关于没有德语字典的PyEnchant的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!