【发布时间】:2020-12-12 16:06:40
【问题描述】:
如何在 Windows 上为 anaconda 添加从 github.com/LibreOffice/dictionaries 到 pyenchant 的字典?
在 SO 上有类似的问题,但不适用于 windows:
-
Add dictionary to pyenchant 存在,但适用于 osx 用户,接受的答案是死链接。
-
How to add dictionary to PyEnchant? 为 linux/ubuntu 用户回答。
-
PyEnchant without German dictionary 为 linux/ubuntu 用户回答。
-
How to download additional dictionaries in pyenchant? 为 linux/ubuntu 用户回答。
背景
我一直在寻找一种方法来检查给定字符串是否是给定语言的有效单词。
我已经 found 并使用 pip 成功(在 Windows 10 上)在 Anaconda Prompt 中安装了 pyenchant,因为它 apparently 可以不能使用 conda 安装 win-32 或 win-64。
(base) C:\Users\V>pip install pyenchant
Collecting pyenchant
Downloading pyenchant-3.2.0-py3-none-win_amd64.whl (11.9 MB)
|████████████████████████████████| 11.9 MB 1.7 MB/s
Installing collected packages: pyenchant
Successfully installed pyenchant-3.2.0
这对我有用。我现在可以打开 Spyder (Python 3.6) 然后运行
import enchant
print(enchant.list_languages())
看看我有一些英文词典
['en_BW', 'en_AU', 'en_BZ', 'en_GB', 'en_JM', 'en_DK', 'en_HK', 'en_GH', 'en_US', 'en_ZA', 'en_ZW', 'en_SG', 'en_NZ', 'en_BS', 'en_AG', 'en_PH', 'en_IE', 'en_NA', 'en_TT', 'en_IN', 'en_NG', 'en_CA']
我想使用 LibreOffice 支持的语言。
【问题讨论】:
标签: python windows anaconda conda pyenchant