PyEnchant without German dictionary

99封情书 提交于 2021-02-18 07:09:18

问题


Thanks to Stackoverflow, I learnt about pyenchant library.

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?

I am using a linux box running Ubuntu.


回答1:


From the terminal type:

sudo apt-get install myspell-de-de

You can check that you have it available, from a Python prompt type:

import enchant
print enchant.list_languages()

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.org-dictionaries

http://packages.ubuntu.com/precise/ispell-dictionary



来源:https://stackoverflow.com/questions/11804481/pyenchant-without-german-dictionary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!