I'd like to use hunspell to spell check my repo. However when I try to run it I get the following error:
Can't open affix or dictionary files for dictionary named "en_US".
How can I fix this? I'm on a Mac.
Thanks, Kevin
I'd like to use hunspell to spell check my repo. However when I try to run it I get the following error:
Can't open affix or dictionary files for dictionary named "en_US".
How can I fix this? I'm on a Mac.
Thanks, Kevin
Execute hunspell -D
. You should get output like this:
.::/usr/share/hunspell:/usr/share/myspell:
/usr/share/myspell/dicts:/Library/Spelling:
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/Library/Spelling/en_GB
LOADED DICTIONARY:
/Library/Spelling/en_GB.aff
/Library/Spelling/en_GB.dic
This lists the directories in which hunspell
is searching for dictionary files, as well as the dictionaries is has found. If the dictionary en_US
isn't listed, you haven't got that particular dictionary installed.
To install a dictionary, search for it in the LibreOffice extension repository. Download it then extract the .aff
and .dic
files to one of the locations listed by hunspell -D
. For example:
# First download dict-en.oxt
unzip dict-en.oxt -d dict-en
cp dict-en/en_GB.aff dict-en/en_GB.dic ~/Library/Spelling/
rm -r dict-en
.aff
and .dic
files. To get these I followed the instructions found at github.com/hunspell/hunspell#usage (minus the hash pin). So in short I used: wget -O en_US.aff https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff
and wget -O en_US.dic https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.dic
–
Tshirt I'm using emacs in windows using msys2. I installed following 2 packages:
pacman -S mingw-w64-x86_64-hunspell-en mingw-w64-x86_64-hunspell
The mingw-w64-x86_64-hunspell-en package install english dictionaries in /mingw64/share/hunspell, but you check if the files (en_US.dic and en_US.aff) are available or not.
Steps:
set the Environment Variable in .bashrc within mysys2. Without DICPATH it was not working for me.
export DICTIONARY=en_US
export DICPATH=/d/../msys2/ming164/share/hunspell
run hunspell.exe -D
SEARCH PATH:
.;... ;...;...
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
D:/xx/mysys64/mingw64/share/hunspell/en_AG
D:/xx/mysys64/mingw64/share/hunspell/en_AU
...
Hunspell 1.6.0
I was lucky to find my language here: https://extensions.openoffice.org/en/search?query=de_CH&sort_by=field_project_stats_year&sort_order=DESC
And with the comment from @RobDavenport i was able to rename the extension and extract the files. Something i reread at this link and gave it a try. I dropped the .dic .dat and .aff into my ~/Library/Spelling/ folder.
© 2022 - 2024 — McMap. All rights reserved.