Expanding the spellchecking lists used by Ispell or Aspell

Q I wish to expand the spellchecking lists used by Ispell or Aspell into a plain list of words in alphabetical order. I want to know how the compression algorithms work, but I can't seem to find any information explaining this. If I knew this I could write a program to decompress the lists - or perhaps use an existing program if there is one included with Ispell or Aspell.

A This can be done with both Ispell and Aspell, although the task is much easier with Aspell, where you use the Aspell program itself, like this:

aspell dump master

to output the master word list, one word per line. If you want them in alphabetical order, pipe the output through sort

aspell dump master | sort

The output from aspell dump can be used as the input for aspell create, so you can dump the word list to a file, edit it then feed it back to aspell create to build a new dictionary.

aspell --lang=LANG create master ./mydict <mywordlist

Although it is possible to manipulate Ispell dictionaries in a broadly similar manner, the process is more involved, so I'd stick with Aspell for this unless you have a particular reason for using Ispell.

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar