hunspell

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


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


Solution

  • 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