Unlearn Spellings on OS X


Built into Mac OS X is a configurable system-wide local dictionary which has a list of correctly spelled words that are unique to you. Potentially any application can be developed to make use of this service. Specifically a lot of the Apple apps such as Mail and TextEdit do use it.

When the system detects a misspelled word, the word in question is underlined in red. If you right click and choose “Learn Spelling”, that specific spelling of that word is added to the dictionary for future use.

Its very easy to ‘Learn’ a word by mistake. Historically to  remove a spelling, you would right click the word and choose unlearn which then removed that spelling from the dictionary.

As of Mac OS X 10.7 not all applications support the unlearn feature. For instance TextEdit does, but Mail does not.

So, if you add a spelling by mistake in Mail what can you do?

1. One option is to just switch to TextEdit, type the word and then right click it and select ‘Unlearn Spelling’.

This is fine but you will be surprised by how many custom spellings accumulate over time.

2. The second method allows you to bulk remove the incorrect spellings from the dictionary.

  • In The Finder, hold the alt key and then from the Go menu, choose Library.
  • In the Library folder locate a folder called “Spelling”. Inside this folder you will find a file called ‘LocalDictionary ‘. Double click the file to open it in TextEdit so we can edit it.
  • Remove any words  you don’t want. Then save and exit.

From experience you may have to log out and back in again, to pick up the changes.

Another use of this method is if you want to make sure certain words are in the dictionary on all your Macs. To do this just update one copy of the file ‘LocalDictionary’ with the spellings you want. Then distribute this file to all other Macs that require it.

Share this post online:

7 Responses to “Unlearn Spellings on OS X”

  1. Jeffery Lay says:

    Interestingly, on my Mac Pro running a fairly clean installation of Mountain Lion, the LocalDictionary file doesn’t seem to get updated. Instead, a file in the same directory called “en_GB”, which is of the same format, gets created and updated.

    One thing which may have affected this is that my system language is set to British English, not the default English (which in this case means American English).

  2. May Wilkinson says:

    I am so hoping you could throw some light on an issue about spelling. I have a MacBook Pro mid 2009 and am running Entourage 2008 with the rest of Office in 2011 version. Things have been fine for years till suddenly, Spellcheck in Entourage started changing i’m to I’M. I have it set to correct it correctly, but it insists on capitalizing the ‘m’. It does not do that to any other declensions. A bit more investigating reveals that it is apostrophe plus the m which creates this, the ‘i’ is irrelevant. That is, any letter, or any combination of letters before the apostrophe, if followed by an ‘m’, makes the ‘m’ become capiltalized. This only happens in Entourage, not in any other app. After I tried to fix it by following your guidelines, above, Mail now thinks all lower case ‘i’m’ is OK and does not flag it up as a spelling error now. I can live with that since I never use Mail, but naturally ‘I’m’ is a very common word in emails and it’s driving me mad that I can’t change it in Entourage automatically. I see some other clues that a degree of corruption may have entered the system but it woukd take too much space and your time to describe. I’d just be grateful if you could throw out some ideas for the apostrophe followed by capitalized M problem.

  3. Dear Mary,

    I would first suggest creating a New user login ( > System Preferences > Users & Groups or  > System Preferences > Accounts), logout of your existing user account, login as the new user.

    Open Entourage and compose a new email. Don’t worry about setting up your email under this new user login as we only need to check the spelling/grammar check. Within the newly composed email type I’m, does it still auto-correct?

    Anton

    • May Wilkinson says:

      Hello Anton,
      I was about to say “I’ve tried that over and over again and it’s fine”. However, I thought i’d give it one more go after your question, having done some trawling, dumping resetting of all kinds files. Lo & behold, the fault does not occur in the new user. So, evidently some sort of setting problems within my normal user log-in. I’ve tried setting, unsetting, resetting and junking so many variations of the preferences, auto-correct etc.. I no longer have any idea of what’s left to do or undo! I hope you may have some bright ideas…..
      May

  4. Scott says:

    There has to be a service to HUP or a command to run to reload the LocalDictionary, restarting should not be needed. Any suggestions? Looking in Activity Monitor.

    I figured it out, just kill AppleSpell.service or open Activity Monitor and find the process ID and send it a kill -9 or a more gentle -HUP PID

    Example: sudo kill -HUP 13426
    To find the PID i.e.: 13426, you will get two lines of processes back, one is the actual grep command, the other is so we can negate the first line we won’t need…

    ps aux | grep -i applespell | grep -v grep

    Then use awk to get just the PID field:

    ps aux | grep -i applespell | grep -v grep | awk ‘{ print $2 }’

    That will give you just the PID number, if you want to kill it all in one go:
    kill -TERM `ps aux | grep -i applespell | grep -v grep | awk ‘{ print $2 }’`

    So, kill -TERM the result of what is in back-ticks. What is in back-ticks will return the PID you desire. Or just go into activity monitor and find on “spell” and force quit that one. I find the command a bit simpler than opening Activity Monitor since I always have a terminal open somewhere or can shove a command to a shell through LaunchBar.

    kill -TERM `ps aux | grep -i applespell | grep -v grep | awk ‘{ print $2 }’`
    so again, kill is a command that takes the argument -TERM, we can’t use -HUP as it will think we are sending in an argument of “p” from the `ps` command sine we are in an interactive shell.

    After the -TERM you see a command in back-ticks, that command is much like if it were code and in parenthesis, it will run, and return a result because it is in back-ticks. This is not the only way to do this, you can use brackets or write a nice clean file of multi-line code. For this, I find a one liner easier.

    Within the back-ticks, first is a call to `ps` which shows your running processes, aux are the arguments, you can look them up with `man ps`. `ps` will list them all, so we use `grep` to filter them out. I add the “i” flag to grep to make it not care about the case of the search term, so AppleSpell or applespell or APPLESPELL will all be treated the same.

    Next is piping all that to `grep` again, this time, telling it to -v, or negate the “grep” search string. This gets rid of the actual process we are running which will be found by the first `grep` search command. Now we are left with one line. We pipe that line to `awk` which is very smart about making anything work like a tab delimited file. I want to get the second item, so I pass in $2 to get to it: awk ‘{ print $2 }’`

    and the whole sheband, copy and paste this:
    kill -TERM `ps aux | grep -i applespell | grep -v grep | awk ‘{ print $2 }’`

    Now, after you make changes to ~/Library/Spelling/LocalDictionary save, run the command above, wait about 5 seconds for AppleSpell.service to reboot, which it will via a launchdaemon, and you are all set.

  5. Ed says:

    Will these suggestions –particularly the TextEdit and Unlearn Spelling technique work with Mavericks?

  6. Inquisitor7 says:

    First option using TextEdit works fine with Mountain Lion OS. Mail now highlighting mistakenly learnt words. Thanks.

Leave a Reply