Next: , Previous: , Up: Working With Dictionaries   [Contents]

5.5 Creating an Individual Word List

To create an individual main word list from a list of words use the command

aspell --lang=lang create master ./base < wordlist

where base is the name of the word list and wordlist is the list of words separated by white space. The name of the word list will automatically be converted to all lowercase. The ./ is important because without it Aspell will create the word list in the normal word list directory. If you are trying to create a word list in a language other than English check the Aspell data-dir (usually /usr/share/aspell, use aspell dump config to find out what it is on your system) to see if a language data file exists for your language. If not you will need to create one. For more information on using Aspell with other languages Adding Support For Other Languages.

This will create the file base in the current directory. To use the new word list copy the file to the normal word list directory (use aspell config to find out what it is) and use the option --master=base.

During the creating of the dictionary you may get a number of warnings or errors about invalid words or affixes. By default Aspell will skip any invalid words and remove invalid affixes. If you rather that Aspell simply accepts all words given then the option --dont-validate-words can be specified. To avoid checking if affixes are valid use the option --dont-validate-affixes. However, rather than disable checking, it is preferable to clean the input word list. This can be done by using the command

aspell --local-data-dir=./ --lang=lang clean < wordlist > result

which will clean the word list and output the results to result. By default it will remove invalid characters from the beginning and end of a word before resorting to skipping the word. If you rather it just skip the words than add the keyword strict:

aspell --local-data-dir=./ --lang=lang clean strict < wordlist > result

The option --clean-words can be be added when creating a dictionary if you want Aspell to remove invalid characters from the beginning and end of a word like the "clean" command does. In addition the options --dont-skip-invalid-words and --dont-clean-affixes can be specified to turn the warnings into errors.

The compiled dictionaries are platform dependent. They depend on the endian order and (unless compiled with the --enable-32-bit-hash-fun option) the size of the size_t type as it used in the hash function; this type is generally different on 32 and 64-bit systems. When a dictionary is loaded the endian order and compatibility of the hash function is checked. Please do not distribute the compiled dictionaries unless you are only distributing them for a particular platform such as you would a binary.

Aspell is now also able to use special multi dictionaries. for more information How Aspell Selects an Appropriate Dictionary.

A personal and replacement word list can be created in a similar fashion.

5.5.1 Format of the Replacement Word List

The replacement word list has each replacement pair on its own line in the following format

misspelled_word correction

Next: , Previous: , Up: Working With Dictionaries   [Contents]