-->
Page 227
Note that the < redirection operator has been used because in the -l mode, the ispell command acts as a spelling filter, checking the input text stream against its dictionary (located under the /usr/lib/ispell directory). You can-redirect this list to a file, or use ispell's -f command-line option:
# ispell -l -f errors -a <LICENSE
This sends all misspelled words to the file called errors. The ispell program has 15 different command-line options. Use the -L option to change the amount of context, or text displayed before and after a suspected error. The -b option creates a backup file of your original document, which is a good idea if you make a mistake and enter a wrong correction (this is the default for your version of ispell).
The ispell package includes nine other programs you can use to build your own dictionaries, or add lists of words from your personal dictionary into ispell's dictionaries. For details about these programs, see the ispell manual page. For details about building your own dictionaries, read the ispell manual page under the /usr/man/man4 directory. You can do this with the following command:
# man 4 ispell
Documentation for ispell is in its two manual pages and under the /usr/doc directory.
When all you need is quick confirmation of the spelling of a single word, you don't have to run your word processor or text editor to get the answer, because you can use the look command, found under the /usr/bin/directory.
Although the look command is normally used to search files and print all lines matching a given string pattern, the look command quickly looks up a word in the system dictionary. If you don't specify a file to search on the look command line, look automatically searches the system dictionary, called words, which is located in the /usr/dict directory. See the following example:
# look consci conscience consciences conscientious conscientiously conscious consciously consciousness
JUST A MINUTE |
The system dictionary, words, is a symbolic link to the file called linux.words, also located in the /usr/dict directory. This dictionary, a 400,000-character, plain |
Page 228
ASCII list of sorted words, contains 45,402 words. You can find an even larger dictionary, called web2, which is more than two megabytes, and contains more than 100,000 words, by searching your favorite Linux Internet sites (try sunsite.unc.edu). |
All you have to do is type several characters of the beginning of a word and the look command prints any matches found in the system dictionary. You also can use the ispell command's -a command-line option to check spelling interactively, or quickly look up a single word, or several words at the keyboard. Lookups are performed on ispell's dictionary, not the system dictionary. See the following example:
# ispell -a @(#) International Ispell Version 3.1.20 10/10/95 seperate & seperate 1 0: separate mispell & mispell 3 0: dispell, ispell, misspell mississippi & mississippi 1 0: Mississippi truncate * [Ctrl-d] #
Notice that ispell starts, prints a short version message, and then waits for your input. When you enter a misspelled word, ispell echoes the word back, and if a suggested replacement is found, prints the replacement with a number. Also note that ispell even corrects words spelled correctly, but not properly capitalized. Finally, if you enter a correct word, ispell merely echoes back an asterisk. To quit, enter an end of text character by holding down the Ctrl key and pressing d.