Mac OS + Scrivener + Hunspell

Some Swedish: Yep! Den här artikeln är på engelska. Tänkte skriva den på LiveJournal, men… nu blir det här istället. Hoppas det funkar!

So, I may just have figured out spell checking in Scrivener.

If you’re writing in English, chances are you’re not really upset with the spell checking in Mac OS/Scrivener.

English is such a nice and ordered language. There are spaces between words and a very limited number of suffixes.

If, however, you’re writing in a language that doesn’t always separate words with spaces or have enough suffixes to create 65 trillion variations with the 10 000 most used ”normal” words, then aspell spell checking (you have a list of words, the program checks to see if the thing you wrote is in there and if not marks it as an error) wont do.

Hunspell to the rescue!

Hunspell does not just look up words in a file of words, it also has an almost programmatic approach to word recognition where dictionaries can contain definitions for words that can be combined, or have different types of suffixes (verbs, nouns, etc).

As far as I’ve understood (being a Scandinavian and all) the only language that has problems even with Hunspell is Finnish. (Well, I guess Navaho would have serious problems with Hunspell — or any other spell checker — as well, since they use prefixes *shudder*).

So, here’s an instruction on installing it.

In essence you install Homebrew (if you don’t already have it installed) and then do:

brew install hunspell

Read the text from brew really careful. It will tell you where the program wants to find dictionaries and that none have been installed.

So, you have to install some dictionaries. I would suggest going with the ones from LibreOffice or OpenOffice.

They come in special module files but those are simply zip-files with a different extension, so extract them with your favorite zip program.

You need to get the xx_XX.dic and xx_XX.aff files (e.g. en_US.dic and en_US.aff) and move them to either /Library/Spelling or ~/Library/Spelling.

Finally, in the System settings > Keyboard > Text section, you must change language to one followed by ”(Library)” (e.g. ”U.S. English (Library)”).

At least I had to do this, but it may be because I added my dictionaries in /Library/Spelling instead och my local home version (~/Library/Spelling) — you may have to choose differently. If you had problems with spell checking before, you should be able to find some of the problematic words and test if they’re still a pain.

Some applications (like Scrivener) will pick up the changes right away, but may have some issues with local dictionaries. You might want to try to restart the program or even reboot the OS.

Then you should be able to use Hunspell dictionaries in Scrivener via Mac OS standard spell checking.

Happy spell checking!