How can I add dictionaries from github.com/LibreOffice/dictionaries to pyenchant
on windows for anaconda?
There are similar questions about this on SO, but not for windows:
Add dictionary to pyenchant exists, but is for osx users and accepted answer is a dead link.
How to add dictionary to PyEnchant? is answered for linux/ubuntu users.
PyEnchant without German dictionary is answered for linux/ubuntu users.
How to download additional dictionaries in pyenchant? is answered for linux/ubuntu users.
Background
I've been looking for a way to check if a given string is a valid word of a given language.
I've found and installed pyenchant
inside the Anaconda Prompt successfully (on Windows 10) by using pip
because it apparently can't be installed with conda
for win-32
nor for 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
This worked for me. I can now open Spyder (Python 3.6) and then run
import enchant
print(enchant.list_languages())
to see that I have some English dictionaries
['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']
I would like to have access to languages supported by LibreOffice.
Find your anaconda package (should be
enchant
).Inside, find your provider (default should be
hunspell
).For me, this is at
Now, simply add
.aff
and.dic
files of the desired language to thishunspell
folder.For example, github.com/LibreOffice/dictionaries/tree/master/hr_HR is for Croatian (Hrvatski).
Then for example,
Returns
as expected. ("mačak" = croatian word for male cat.)