spell(C) 19 June 1992 spell(C) Name spell, hashmake, spellin, hashcheck - find spelling errors Syntax spell [ -v ] [ -b ] [ -x ] [ -l ] [ -i ] [ +localfile ] [ files ] /usr/lib/spell/hashmake /usr/lib/spell/spellin n /usr/lib/spell/hashcheck spellinglist Description The spell command collects words from the named files and looks them up in a spelling list. Words that neither occur among nor are derivable (by applying certain inflections, prefixes, and/or suffixes) from words in the spelling list are printed on the standard output. If no files are named, words are collected from the standard input. spell ignores most troff(CT), tbl(CT), and eqn(CT) constructions. Under the -v option, all words not literally in the spelling list are printed, and plausible derivations from the words in the spelling list are indicated. Under the -b option, British spelling is checked. Besides preferring centre, colour, programme, speciality, travelled, etc., this option insists upon -ise in words like standardise. Under the -x option, every plausible stem is printed with ``='' for each word. By default, spell (like deroff(CT)) follows chains of included files (.so and .nx troff requests), unless the names of such included files begin with /usr/lib. Under the -l option, spell will follow the chains of all included files. Under the -i option, spell will ignore all chains of included files. Under the +localfile option, words found in localfile are removed from spell's output. localfile is the name of a user-provided file that con- tains a sorted list of words, one per line. With this option, the user can specify a set of words that are correct spellings (in addition to spell's own spelling list) for each job. The spelling list is based on many sources, and while more haphazard than an ordinary dictionary, it is also more effective with respect to proper names and popular technical words. Coverage of the specialized vocabu- laries of biology, medicine, and chemistry is light. Pertinent auxiliary files may be specified by name arguments, indicated below with their default settings (see ``Files''). Copies of all output are accumulated in the history file. The stop list filters out misspel- lings (for example, thier=thy-y+ier) that would otherwise pass. Three routines help maintain and check the hash lists used by spell: hashmake Reads a list of words from the standard input and writes the corresponding nine-digit hash codes on the standard output. spellin n Reads n hash codes from the standard input and writes a compressed, or hashed spellinglist such as /usr/lib/spell/hlista or /usr/lib/spell/hlistb, on the stan- dard output. Information about the hash coding is printed on standard error. hashcheck Reads a compressed, or hashed spellinglist, such as /usr/lib/spell/hlista or /usr/lib/spell/hlistb, and recre- ates the nine-digit hash codes for all the words in it, writing these codes on the standard output. Examples This example adds the words in newwords to the on-line dictionary (/usr/lib/spell/hlista): cd /usr/lib/spell cat newwords | ./hashmake | sort -u > newcodes cat hlista | ./hashcheck > hashcodes cat newcodes hashcodes | sort -u > newhash cat newhash | ./spellin `cat newhash | wc -l` > hlist mv hlista hlista.00 mv hlist hlista cd /usr/dict cat newwords words | sort -du > tempwords mv words words.00 mv tempwords words Remember to remove all temporary files after you are sure everything works. The following example removes words from the on-line dictionary. You should first make a copy of /usr/dict/words that does not have the words you want to remove. Make sure the file is sorted in alphabetical order. Then, follow these steps: cd /usr/lib/spell cat /usr/dict/words | ./hashmake > hashcodes cat hashcodes | ./spellin `cat hashcodes | wc -l` > newhlist mv hlista hlista.00 mv newhlist hlista Note that when you are manipulating large text, hash and hash code files, you should use cat(C) to open the files, since they may be extremely large. Files DSPELL=/usr/lib/spell/hlist[ab] hashed spelling lists, American & British SSPELL=/usr/lib/spell/hstop hashed stop list HSPELL=/usr/lib/spell/spellhist history file /usr/lib/spell/spellprog program See also deroff(CT), eqn(CT), sed(C), sort(C), tbl(CT), tee(C), troff(CT) Notes The spelling list coverage is uneven; new installations will probably wish to monitor the output for several months to gather local additions; typically, these are kept in a separate local file that is added to the hashed spellinglist via spellin. By default, logging of errors to /usr/lib/spell/spellhist is turned off. DSPELL and SSPELL can be overridden by placing alternate definitions in your environment. Standards conformance hashcheck, hashmake and spellin are conformant with: AT&T SVID Issue 2. spell is conformant with: AT&T SVID Issue 2; and X/Open Portability Guide, Issue 3, 1989.