Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hunspell - Can't open affix or dictionary files for dictionary named en_US

Tags:

hunspell

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

like image 746
Kevin Burke Avatar asked Jan 19 '12 18:01

Kevin Burke


1 Answers

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 
like image 143
Divinenephron Avatar answered Sep 21 '22 17:09

Divinenephron