|Previous||Table of Contents||Next|
The external spell command checks input for spelling errors. It compares the words it reads from input to words in its spelling list. If a word is not located in its list, then the word is printed on the standard output. spell adds suitable prefixes, suffixes, and inflections to derive the correct spelling of a word.
Most troff, nroff, tbl, eqn, and pic constructions are ignored by spell. The deroff command is executed by spell to remove these constructs.
By default spell follows chains of troff and nroff include files. Include files are preceded by .so or .nx constructs. If the filename begins with /usr/lib, spell ignores the file and does not read it. Most /usr/lib files are mm macros created by vendors, not by users. If the -l option is specified, then all include files are read, even the /usr/lib files.
The spelling list file was created from many sources. Although it is not a Webster's Dictionary, it is very effective with respect to proper names and technical words. Unfortunately, the coverage of special professions such as biology, chemistry, and medicine is lacking to say the least.
The hashmake command converts a list of words to a list of nine-digit hash codes. The list of words are read from the standard input. The list of hash codes are written to the standard output. The output of hashmake is an intermediate file used by spellin to create the final spelling list (hlist).
The spellin command converts hash codes to a hashed compressed spelling list. The hash codes are read from the standard input. The compressed spelling list is written to the standard output. The output of spellin is the final spelling list used by spell; the file is referred to as the hlist.
The hashcheck command converts a compressed spelling list to a list of hash codes. The compressed spelling list is read from the standard input. The hash code list is written to the standard output. You use the hashcheck command to verify that the compressed spelling list is valid.
|The spellin command creates a hashed compressed spelling list. The ASCII word list is read from the standard input. If a filename is given it is assumed to be an existing spelling list file (hlist). The output, a new or updated spelling list, is written to the standard output.|
|The spellout command searches the given hashed spelling list (hlist) for each word read from the standard input. If the list does not contain one of the input words, the word is written to the standard output. With the -d option specified, the word is written to the standard output if it does exist in the hashed list.|
Following is the general format of the spell command.
spell [ -blvx ] [ +local_file ] [ file_list ] /usr/lib/spell/hashmake /usr/lib/spell/spellin n /usr/lib/spell/hashcheck word_list
|spell [ -bvx ] [ -d hlist ] [ -h spellhist ] [ -s hstop ] [ file
spellin [ list ]
spellout [ -d ] list
Most users only use the spell command. The other commands are usually used by the system administrator to add words to the spelling list.
The following list describes the options and their arguments that may be used to control how spell functions.
|-b||Check for British spelling. The ise ending is required in words such as standardize. Such spelling as colour and centre are checked.|
|-l||Causes the files referenced in a troff document to be read even if their pathname begins with /usr/lib. Normally spell will check the spelling of chained files in a troff document, unless the pathname of the file begins with /usr/lib. Chained files are .so and .nx requests in a troff document.|
|-v||Displays all words not literally in the spelling list. All reasonable alternative words are displayed if any exist.|
|-x||Displays possible stems, prefixed with an equal sign (=), for each word being checked.|
|+local_file||Words listed in local_file are removed from spell's output of misspelled words. The local_file contains a sorted list of words, one per line. You can use this file to store a list of correctly spelled words unknown to the normal spelling list (hlist).|
|-d hlist||Use hlist as the spelling list file instead of the default. The default is /usr/dict/hlist[ab].|
|-h spellhist||Use spellhist as the history file instead of the default. The default is /dev/null. The history file contains a copy of all words spelled incorrectly according to spell.|
|-s hstop||Use hstop as the stop list file instead of the default. The default is /usr/dict/hstop.|
|See the following section "Control Files" for definitions of these three files.|
The following list describes the arguments that may be passed to the spell command.
|file_list||One or more files read and each word checked for correct spelling.|
|If no files are listed the standard input is read for words.|
The following files are used by spell to verify the correct spelling of the input word list.
|hlist||The list of correctly spelled words in hashed format.|
|spellhist||Copies of all output. This provides the system administrator with a list of words that have been rejected by spell as incorrect. Technical words may be taken from the list and added to the list of correctly spelled words (hlist).|
|hstop||The list of words used to filter out words that pass the normal spell checking. For example, their=they-ey+eir.|
The following environment variables may be set to override the default files used by spell. They correspond to the BSD -d, -h, and -s options.
|D_SPELL=hlist||Defines your hlist file instead of the default. The default is /usr/lib/spell/ hlist[ab].|
|H_SPELL=spellhist||Defines your spellhist file instead of the default. The default is /usr/lib/ spell/spellhist.|
|S_SPELL=hstop||Defines your hstop file instead of the default. The default is /usr/lib/spell/ hstop.|
Generating New hlist
To generate a new hlist (correctly spelled words) perform the following steps.
To check the hash list.
You now have a correct and functional hlist file to use for your own words.
|1. Create a list of correctly spelled words. Use vi or another favorite editor. Name the file goodwords.|
|2. Type cat goodwords | spellin > hlist and press Return. This creates a hashed spelling list.|
|To check the hash list.|
|3. Type cat goodwords | spellout hlist and press Return. Any words in goodwords not in the hash list (hlist) are displayed on your terminal.|
DIAGNOSTICS AND BUGS
New installations will probably find it necessary to monitor the output of spell on local documents to collect a local spelling list. Once the list is collected, a new local list can be added to spell's list of words.
The spell command reads from files or from the standard input. It writes any misspelled words to the standard output. It uses different files for spell checking located in the /usr/lib/spell directory.
The spell command is used to check your documents for spelling errors. Unfortunately, it is not interactive in correcting the misspelled words, nor does it suggest correct spellings.
In this activity you use the spell command to check the spelling of words in a file. Begin at the shell prompt.
cj> spell file1 file1
|Previous||Table of Contents||Next|