Aspell :: "Learn All" in one command?

Since Scrivener’s using Aspell for spellchecking, I was wondering if anyone knows how to ”learn” all the underlined words in just one command. If it’s possible, that is.

Let’s say I import text I know is correctly spelled (words that are not in Aspell’s internal wordlist) and I want to add underlined words to my personal wordlist. Is there a way to add the all in one command? Choosing “learn” x hundred times is quite tiring …

Thanks in advance.

I don’t think there’s a “learn all” command. One possible method, though not much easier than learning one by one, is Tools > Options > Corrections > View Personal Word List. Here you can manually add words to the dictionary.

More daringly (and I presume not supported by the makers of Scrivener), the personal dictionary file is AppData\Local\Scrivener\Scrivener\wordlists.ini, located under your Windows user name folder. This is a text file that can be edited; here too you could add in all the words you want. I’d back up the .ini file first before doing this, though, and test it with a couple of words to make sure it works. If this is too big a risk for the average user, somebody else chime in here!


Yes, I know about the wordlists.ini. But like you said, I might as well add the words one by one through Scrivener’s “Learn Spelling” command from the menu.

Oh, well, I’ll try to write some VB(A) code to do that for me …

Thanks anyway.

I think you could adapt these Unix-y instructions for working with a list of words on the command line without actually writing a program. … ctionaries

It’ll be pretty similar to the article, except for locations, if you install Sygwin utilities, which gives you a kind of Unix-like interface (if that’s your cup of tea; I hear Powershell is pretty good if you have that on your version of Win).

I note that the first instruction in the material that robert linked to is “Create a file list named yourlist.txt. Add words, one per line, to yourlist.txt.” So it seems that this too involves typing every word that you want to have the speller accept, which seems to me no easier than just editing wordlists.ini. But I may not be understanding the process.

Valle, would your VB(A) code produce something that could read a file, check it against the existing Aspell list, and output the words not found to a new list for inclusion in wordlists.ini? That seems (to my small understanding) like the only truly “learn all” method, and even then I’d think the resulting list would need to be proofread. But if there are hundreds of words involved this would be more efficient than right-click, Learn over and over again.

Typing every word would be ludicrous. But I see your point, assuming the wordlist.ini file is tolerant of human errors (extra white space after words, brackets, = signs, etc…) I got the impression from that article that it’s best to let aspell do the adding of a list of words for you.

Ah, that would make sense. I don’t work with aspell independently of Scrivener, so I probably just didn’t understand it.

I took a longer look at the command line when you run “aspell.exe”, which gives you a list of options.

Here’s one that’s relevant:
-l|list produce a list of misspelled words from standard input

So you don’t have to make a separate list by hand–you just have to export the file or files that contain the words you want aspell to learn to plain text, and then use this option to produce the list of words you (believe) you want added to the dictionary. If you install cygwin on your computer, you’d then be able to sort the list alphabetically, remove any duplicates (I don’t know if aspell produces duplicates or not, but it might), and then save that file for any future uses like this (you could even import it into a scrivener project to keep track of the list and add to it…

/cygdrive/c/Program\ Files/Scrivener/Aspell/binaspell.exe --check yourdocumentinplaintext.txt --list | sort | uniq > listofspecialwords.txt

Of course, if you’d rather write a program than deal with a Unix/Linux/Mac-like command line, then good luck to you! :slight_smile: