Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remove accidental additions to the spelling dictionary System
If you ever accidently clicked "Learn" in the spelling window of any Cocoa app, your dictionary will not recognize the wrong word the next time you repeat your mistake. If you want to make it "unlearn" the word, start by opening the folder ~/Library -> Spelling. You may find several files, one for each dictionary you use e.g.: en for English, Multilingual, pt_BR for Brazilian Portuguese, etc.

If you open one of these files in TextEdit or BBEdit, you will see that the words are not separated at all, and for some reason, pico will only recognize the first word added. I suggest using emacs in the Terminal, which separates each entrance by a ^@ symbol. You should type something like this:
emacs ~/Library/Spelling/en
Its also a nice way to add lots words using copy/paste.
    •    
  • Currently 2.14 / 5
  You rated: 3 / 5 (7 votes cast)
 
[21,708 views]  

Remove accidental additions to the spelling dictionary | 20 comments | Create New Account
Click here to return to the 'Remove accidental additions to the spelling dictionary' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Emacs basics
Authored by: paulio on Aug 12, '04 11:33:00AM

WoW! How many normal people know anything about Emacs? Bare minimum knowledge:

<ctrl-s> starts incremental search mode
arrow keys stop the mode

<ctrl-x><ctrl-s><ctrl-x><ctrl-c> saves and exits
<ctrl-x><ctrl-c> exits without saving



[ Reply to This | # ]
Emacs basics
Authored by: allentown on Aug 21, '14 10:05:15PM

Agreed, it's as if the OP wants people to know they are using some alternate editor, and it's not vi/vim so it must be spurt cool. On a hint like this I also see people saying to open TextEdit, make sure to alter your preferences to plain text, etc, or download TextWrangler.

We are working on a file deeper in the system that the Finder readily shows us. Actually, Apple hides ~/Library from the user on a default install.

In these cases, I say, why not take the safe road, don't introduce any strange characters, don't convert tabs to spaces, or spaces to tabs, all things that can happen if you open the file in TextEdit, TextWrangler, or any GUI based editing app. I think TextMate may spare you any troubles.

Either way, just use pico, which has been aliases to nano, using the -w flag to make sure word wrap does not truncate any long files, like a log file.

It is very easy, and all the instructions are right there in the editor. For lightweight edits, I still use it to this day, and I am have used and tried all the alternative editors out there, always on a quest for just the right one.

Here is how simple it is:
pico -w ~/path/to/file/words.txt
That will open the file called words.txt, if words.txt does not exists, it will open a window called words.txt which when saved, will put the file words.txt at that path.

You use the arrow keys to move around. There are shortcuts to move around more easily, cut entire lines, and a lot more. It is in all honesty, a pretty capable editor if you take the time to set it up. It even has full preferences that can be saved instead of passing them on the command line every time, which you put at ~/.nanorc

Instructions on how to save are with the rest of the instructions at the bottom of the window. There is also a help section, where you can really dig into how the app works. Once you have made your changes, press control-x which will make nano ask you if you want to save, press the letter "Y" and it will ask you the name of the file you want to write out, this is your opportunity to write over the existing file, or perform what we all know as a "save as". I just hit the enter key and it will write over the file.

This returns you to the shell as it was before you entered into pico/nano. If you issue ls -la you can look at the date on the file you just edited and see that it has been changed. You can also run `cat ~/path/to/file/words.txt` and see the changes really quickly.

For quick edits just use nano, which is the same as pico more or less, and in this case, they are interchangeable as Apple has linked the call to pico to nano, as you can see here:

Here is where the "binary" of pico is:
$whereis pico
/usr/bin/pico

If we list the "binary" of pico and learn a little about it we can see it is in fact not a binary, but a link to another app called nano, which is a binary…
$ls -la /usr/bin/pico
lrwxr-xr-x 1 root wheel 4 Mar 5 00:16 /usr/bin/pico -> nano

the -> means it is a symbolic link. Both actually are full binaries, it just looks like Apple has decided that they want you using nano no whether you type in pico or nano, you are going to be forced into using nano. You can use pico if you want by calling it as it's full path, so /usr/bin/pico -w ~/Library/Spelling/LocalDictionary

Here is quick way to prove that they are in face full binaries, compiled, and Apple is pushing one to be used over the other, probably for good reason, there may be bugs in pico. They are darn near identical apps.

Here is a `file` listing of them to show they are compiled as 64 bit binaries:
$file `whereis nano`
/usr/bin/nano: Mach-O 64-bit executable x86_64

$file `whereis pico`
/usr/bin/pico: Mach-O 64-bit executable x86_64



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: pascalpp on Aug 12, '04 11:56:54AM

I was excited to see this hint, as I have accidentally added the word 'i' to my dictionary, and I wanted to remove it so the speller would remind me to capitalize my I's... but there's no Spelling directory in my home library. Any idea where else the user dictionary could live?



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: pascalpp on Aug 12, '04 03:06:23PM

Hmm. I just added a nonsense word to the dictionary and then the directory ~/Library/Spelling shows up. So I guess I never added the word 'i' to my dictionary; the word 'i' just isn't flagged by default by the built-in speller. I wonder if there's a way to make it get flagged as a misspelling?



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: RickoKid on Aug 15, '04 10:57:32PM

I don't think the spell checker will pick up any single letters.



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: fbitterlich on Aug 12, '04 12:07:40PM

You can actually open it in BBEdit, just make sure you enable the "Show invisible characters" option. The word separator shows up as a red "¿" character.



[ Reply to This | # ]
BBEdit
Authored by: Pedro Estarque on Aug 12, '04 03:33:59PM

Yes you are write, Edit/Text options.../Show Invisibles
much cleaner then emacs



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: subscriber3 on Aug 12, '04 02:06:48PM

for those not up to emacs, and who don't have BBEdit, there is an option to see the invisibles in the freeware app:

iText

http://members.aol.com/iText/pad_file.htm



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: osxpounder on Aug 13, '04 11:30:08AM

That's kind of you; thanks for the link.

---
--
osxpounder



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: dcoyle on Aug 12, '04 04:22:50PM

Smultron also shows invisible characters.



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: jeremyp on Aug 12, '04 05:28:57PM
vi ~/Library/en

Accept no substitute

[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: zzen on Aug 12, '04 07:09:44PM
Right brother!!!
Preach it to those lowly sinners!

[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: Arif on Aug 12, '04 08:52:24PM

well vi ~/Library/en did *censored* all in 10.2.8 except for showing a few ~



[ Reply to This | # ]
The better answer
Authored by: paulio on Aug 12, '04 10:13:45PM

This is all way too complicated. There is a better answer.

The better way is to remove the accidently learned word the way Apple intended. There is a mechanism for doing this already in place.

In Mail, for example, pull down Edit | Spelling | Spelling... Among the fields available, there is one field in which it is possible to type a word. Type in the accidently learned word and click on the Forget button.

That's all. Easy.



[ Reply to This | # ]
The better answer
Authored by: mudpup on Aug 12, '04 11:06:42PM


Where is the fun in that?



[ Reply to This | # ]
The better answer
Authored by: osxpounder on Aug 13, '04 11:32:53AM

Fantastic. Thanks for pointing that out; I'd rather do it that way, myself.

---
--
osxpounder



[ Reply to This | # ]
The better answer
Authored by: subscriber3 on Aug 13, '04 12:02:23PM

this is good for removing a single word you know is misspelled.

but it doesn't allow you to look for misspelled words.



[ Reply to This | # ]
The better answer
Authored by: d_h on Aug 14, '04 02:07:57AM

Another reason for not editing the spelling dictionaries directly is that you seem to have to log out to get the changes recognised.

A while ago I was looking at loading a custom word list in all at once, the trouble was the delimiter was a character the machine couldn't show and I couldn't type. In the end I think I used a python script to find out the ascii value of the character and write it in with a script.



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: rsteck56 on Mar 30, '10 10:37:35AM

This worked for me in Snow Leopard. I accidentally added geneaology to the Dictionary. I removed the word as follows:

In Finder, navigate to ~/Library/Spelling/LocalDictionary.

You will see the misspelled word there. Delete the word.



[ Reply to This | # ]
Remove accidental additions to the spelling dictionary
Authored by: iheijoushin on Aug 22, '13 09:31:44AM
^ THIS. As of Snow Leopard (and even in Mavericks), the user's custom dictionary is stored here: at ~/Library/Spelling/LocalDictionary . I recommend using the following terminal commands to make your changes:
vi ~/Library/Spelling/LocalDictionary
You should now see a list of words you have added with one line per word. You can use the arrow keys to move up and down. Navigate until your cursor is blinking on the word you wish you remove. Then type:
dd
The word should disappear. Rinse and repeat as needed. Once finished type this exactly:
:wq
And hit return. This saves (w=writes) and quits the document. This should bounce you out of the document and take you back to where you started in Terminal. You are free to close the Terminal window. Tip: If you have a long list of custom words, you can save time by typing:
/EXAMPLEWORD
And hit return. Naturally, replace EXAMPLEWORD above for a portion or all of the word you are searching for. After pressing return your cursor should be bounced to the word. From here you can follow the instructions above to remove it and save the document. This page is very out of date and should be updated.

[ Reply to This | # ]