SPELL(CT) XENIX System V SPELL(CT)
Name
spell, hashmake, spellin, hashcheck - Finds spelling errors.
Syntax
spell [ -v ] [ -b ] [ -x ] [ -l ] [ -i ] [ +local_file ] [
files ]
/usr/lib/spell/hashmake
/usr/lib/spell/spellin n
/usr/lib/spell/hashcheck spelling_list
Description
spell 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(CT) 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 +local_file option, words found in local_file are
removed from spell's output. Local_file is the name of a
user-provided file that contains 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
Page 1 (printed 8/7/87)
SPELL(CT) XENIX System V SPELL(CT)
effective with respect to proper names and popular technical
words. Coverage of the specialized vocabularies 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 misspellings (e.g.,
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 spelling_list,
such as /usr/lib/spell/hlista or
/usr/lib/spell/hlistb , on the standard output.
Information about the hash coding is printed on
standard error.
hashcheck Reads a compressed, or hashed spelling_list,
such as /usr/lib/spell/hlista or
/usr/lib/spell/hlistb , and recreates 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.
Page 2 (printed 8/7/87)
SPELL(CT) XENIX System V SPELL(CT)
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
D_SPELL=/usr/lib/spell/hlist[ab] hashed spelling lists,
American & British
S_SPELL=/usr/lib/spell/hstop hashed stop list
H_SPELL=/usr/lib/spell/spellhist history file
/usr/lib/spell/spellprog program
See Also
deroff(CT), eqn(CT), sed(CT), sort(CT), tbl(CT), tee(C),
troff(CT)
Notes
The spelling list's 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
spelling_list via spellin.
By default, logging of errors to /usr/lib/spell/spellhist is
turned off.
D_SPELL and S_SPELL can be overridden by placing alternate
definitions in your environment.
Page 3 (printed 8/7/87)