ISPELL(1)
NAME
ispell, buildhash, munchlist, findaffix, tryaffix, icombine, ijoin Interactive spelling checking
SYNOPSIS
ispell [common-flags] [-M|-N] [-Lcontext] [-V] files ispell [common-flags] -l ispell [common-flags] [-f file] [-s] {-a|-A} ispell [-d file] [-w chars] -c ispell [-d file] [-w chars] -e[e] ispell [-d file] -D ispell -v[v] common-flags: [-t] [-n] [-h] [-b] [-x] [-B] [-C] [-P] [-m] [-S] [-d file] [-p file] [-w chars] [-W n] [-T type] buildhash [-s] dict-file affix-file hash-file buildhash -s count affix-file munchlist [-l aff-file] [-c conv-file] [-T suffix] [-s hash-file] [-D] [-v] [-w chars] [files] findaffix [-p|-s] [-f] [-c] [-m min] [-M max] [-e elim] [-t tabchar] [-l low] [files] tryaffix [-p|-s] [-c] expanded-file affix [+addition] icombine [-T type] [aff-file] ijoin [-s|-u] join-options file1 file2
DESCRIPTION
- Ispell is fashioned after the spell program from ITS (called ispell on
Twenex systems.) The most common usage is "ispell filename". In this
case, ispell will display each word which does not appear in the dictionary at the top of the screen and allow you to change it. If there
are "near misses" in the dictionary (words which differ by only a single letter, a missing or extra letter, a pair of transposed letters, or
a missing space or hyphen), then they are also displayed on following
lines. As well as "near misses", ispell may display other guesses at
ways to make the word from a known root, with each guess preceded by
question marks. Finally, the line containing the word and the previous
line are printed at the bottom of the screen. If your terminal can
display in reverse video, the word itself is highlighted. You have the
option of replacing the word completely, or choosing one of the suggested words. Commands are single characters as follows (case is
ignored):
- R Replace the misspelled word completely.
- Space Accept the word this time only.
- A Accept the word for the rest of this ispell session.
- I Accept the word, capitalized as it is in the file, and
update private dictionary.
- U Accept the word, and add an uncapitalized (actually, all
lower-case) version to the private dictionary.
- 0-n Replace with one of the suggested words.
- L Look up words in system dictionary (controlled by the
WORDS compilation option).
- X Write the rest of this file, ignoring misspellings, and
start next file.
- Q Exit immediately and leave the file unchanged.
- ! Shell escape.
- ^L Redraw screen.
- ^Z Suspend ispell.
- ? Give help screen.
- If the -M switch is specified, a one-line mini-menu at the bottom of the screen will summarize these options. Conversely, the -N switch may be used to suppress the mini-menu. (The minimenu is displayed by default if ispell was compiled with the MINIMENU option, but these two switches will always override the default).
- If the -L flag is given, the specified number is used as the number of lines of context to be shown at the bottom of the screen (The default is to calculate the amount of context as a certain percentage of the screen size). The amount of context is subject to a system-imposed limit.
- If the -V flag is given, characters that are not in the 7-bit ANSI printable character set will always be displayed in the style of "cat -v", even if ispell thinks that these characters are legal ISO Latin-1 on your system. This is useful when working with older terminals. Without this switch, ispell will display 8-bit characters "as is" if they have been defined as string characters for the chosen file type.
- "Normal" mode, as well as the -l, -a, and -A options (see below) also accepts the following "common" flags on the command line:
-t The input file is in TeX or LaTeX format.- -n The input file is in nroff/troff format.
- -h The input file is in html format. (This works well for
XML and SGML format, too.)
- -g The input file is in Debian control file format. Ispell
will ignore everything outside the Description(s).
- -b Create a backup file by appending ".bak" to the name of
the input file.
- -x Don't keep the backup file (it is still created when
changes are made).
- -B Report run-together words with missing blanks as spelling
errors.
- -C Consider run-together words as legal compounds.
- -P Don't generate extra root/affix combinations.
- -m Make possible root/affix combinations that aren't in the
dictionary.
- -S Sort the list of guesses by probable correctness.
- -d file
Specify an alternate dictionary file. For example, use -d british to choose /usr/lib/ispell/british.{aff|hash} instead of your default ispell dictionary.
- -p file
Specify an alternate personal dictionary.
- -w chars
Specify additional characters that can be part of a word.
- -W n Specify length of words that are always legal.
- -T type
Assume a given formatter type for all files.
- The -n and -t options select whether ispell runs in nroff/troff (-n) or TeX/LaTeX (-t) input mode (This does not work for html (-h) mode. However html-mode is assumed for any files with a ".html" or ".htm" extension unless nroff/troff or TeX/LaTeX modes have been explicitly defined). (The default mode is controlled by the DEFTEXFLAG installation option.) TeX/LaTeX mode is also automatically selected if an input file has the extension ".tex", unless overridden by the -n switch. In TeX/LaTeX mode, whenever a backslash ("\") is found, ispell will skip to the next whitespace or TeX/LaTeX delimiter. Certain commands contain arguments which should not be checked, such as labels and reference keys as are found in the \cite command, since they contain arbitrary, non-word arguments. Spell checking is also suppressed when in math mode. Thus, for example, given
\chapter {This is a Ckapter} \cite{SCH86}- ispell will find "Ckapter" but not "SCH". The -t option does not recognize the TeX comment character "%", so comments are also spellchecked. It also assumes correct LaTeX syntax. Arguments to infrequently used commands and some optional arguments are sometimes checked unnecessarily. The bibliography will not be checked if ispell was compiled with IGNOREBIB defined. Otherwise, the bibliography will be checked but the reference key will not.
- References for the tib(1) bibliography system, that is, text between a ``[.'' or ``<.'' and ``.]'' or ``.>'' will always be ignored in TeX/LaTeX mode.
- The -b and -x options control whether ispell leaves a backup (.bak) file for each input file. The .bak file contains the pre-corrected text. If there are file opening / writing errors, the .bak file may be left for recovery purposes even with the -x option. The default for this option is controlled by the DEFNOBACKUPFLAG installation option.
- The -B and -C options control how ispell handles run-together words, such as "notthe" for "not the". If -B is specified, such words will be considered as errors, and ispell will list variations with an inserted blank or hyphen as possible replacements. If -C is specified, runtogether words will be considered to be legal compounds, so long as both components are in the dictionary, and each component is at least as long as a language-dependent minimum (3 characters, by default). This is useful for languages such as German and Norwegian, where many compound words are formed by concatenation. (Note that compounds formed from three or more root words will still be considered errors). The default for this option is language-dependent; in a multi-lingual installation the default may vary depending on which dictionary you choose.
- The -P and -m options control when ispell automatically generates suggested root/affix combinations for possible addition to your personal dictionary. (These are the entries in the "guess" list which are preceded by question marks.) If -P is specified, such guesses are displayed only if ispell cannot generate any possibilities that match the current dictionary. If -m is specified, such guesses are always displayed. This can be useful if the dictionary has a limited word list, or a word list with few suffixes. However, you should be careful when using this option, as it can generate guesses that produce illegal words. The default for this option is controlled by the dictionary file used.
- The -S option suppresses ispell's normal behavior of sorting the list of possible replacement words. Some people may prefer this, since it somewhat enhances the probability that the correct word will be lownumbered.
- The -d option is used to specify an alternate hashed dictionary file, other than the default. If the filename does not contain a "/", the library directory for the default dictionary file is prefixed; thus, to use a dictionary in the local directory "-d ./xxx.hash" must be used. This is useful to allow dictionaries for alternate languages. Unlike previous versions of ispell, a dictionary of /dev/null is illegal, because the dictionary contains the affix table. If you need an effectively empty dictionary, create a one-entry list with an unlikely string (e.g., "qqqqq").
- The -p option is used to specify an alternate personal dictionary file. If the file name does not begin with "/", $HOME is prefixed. Also, the shell variable WORDLIST may be set, which renames the personal dictionary in the same manner. The command line overrides any WORDLIST setting. If neither the -p switch nor the WORDLIST environment variable is given, ispell will search for a personal dictionary in both the current directory and $HOME, creating one in $HOME if none is found. The preferred name is constructed by appending ".ispell_" to the base name of the hash file. For example, if you use the English dictionary, your personal dictionary would be named ".ispell_english". However, if the file ".ispell_words" exists, it will be used as the personal dictionary regardless of the language hash file chosen. This feature is included primarily for backwards compatibility.
- If the -p option is not specified, ispell will look for personal dictionaries in both the current directory and the home directory. If dictionaries exist in both places, they will be merged. If any words are added to the personal dictionary, they will be written to the current directory if a dictionary already existed in that place; otherwise they will be written to the dictionary in the home directory.
- The -w option may be used to specify characters other than alphabetics which may also appear in words. For instance, -w "&" will allow "AT&T" to be picked up. Underscores are useful in many technical documents. There is an admittedly crude provision in this option for 8-bit international characters. Non-printing characters may be specified in the usual way by inserting a backslash followed by the octal character code; e.g., "\014" for a form feed. Alternatively, if "n" appears in the character string, the (up to) three characters following are a DECIMAL code 0 - 255, for the character. For example, to include bells and form feeds in your words (an admittedly silly thing to do, but aren't most pedagogical examples):
n007n012- Numeric digits other than the three following "n" are simply numeric characters. Use of "n" does not conflict with anything because actual alphabetics have no meaning - alphabetics are already accepted. Ispell will typically be used with input from a file, meaning that preserving parity for possible 8 bit characters from the input text is OK. If you specify the -l option, and actually type text from the terminal, this may create problems if your stty settings preserve parity.
- The -W option may be used to change the length of words that ispell always accepts as legal. Normally, ispell will accept all 1-character words as legal, which is equivalent to specifying "-W 1." (The default for this switch is actually controlled by the MINWORD installation option, so it may vary at your installation.) If you want all words to be checked against the dictionary, regardless of length, you might want to specify "-W 0." On the other hand, if your document specifies a lot of three-letter acronyms, you would specify "-W 3" to accept all words of three letters or less. Regardless of the setting of this option, ispell will only generate words that are in the dictionary as suggested replacements for words; this prevents the list from becoming too long. Obviously, this option can be very dangerous, since short misspellings may be missed. If you use this option a lot, you should probably make a last pass without it before you publish your document, to protect yourself against errors.
- The -T option is used to specify a default formatter type for use in generating string characters. This switch overrides the default type determined from the file name. The type argument may be either one of the unique names defined in the language affix file (e.g., nroff) or a file suffix including the dot (e.g., .tex). If no -T option appears and no type can be determined from the file name, the default string character type declared in the language affix file will be used.
- The -l or "list" option to ispell is used to produce a list of misspelled words from the standard input.
- The -a option is intended to be used from other programs through a pipe. In this mode, ispell prints a one-line version identification message, and then begins reading lines of input. For each input line, a single line is written to the standard output for each word checked for spelling on the line. If the word was found in the main dictionary, or your personal dictionary, then the line contains only a '*'. If the word was found through affix removal, then the line contains a '+', a space, and the root word. If the word was found through compound formation (concatenation of two words, controlled by the -C option), then the line contains only a '-'.
- If the word is not in the dictionary, but there are near misses, then the line contains an '&', a space, the misspelled word, a space, the number of near misses, the number of characters between the beginning of the line and the beginning of the misspelled word, a colon, another space, and a list of the near misses separated by commas and spaces. Following the near misses (and identified only by the count of near misses), if the word could be formed by adding (illegal) affixes to a known root, is a list of suggested derivations, again separated by commas and spaces. If there are no near misses at all, the line format is the same, except that the '&' is replaced by '?' (and the near-miss count is always zero). The suggested derivations following the near misses are in the form:
[prefix+] root [-prefix] [-suffix] [+suffix]- (e.g., "re+fry-y+ies" to get "refries") where each optional pfx and sfx is a string. Also, each near miss or guess is capitalized the same as the input word unless such capitalization is illegal; in the latter case each near miss is capitalized correctly according to the dictionary.
- Finally, if the word does not appear in the dictionary, and there are no near misses, then the line contains a '#', a space, the misspelled word, a space, and the character offset from the beginning of the line. Each sentence of text input is terminated with an additional blank line, indicating that ispell has completed processing the input line.
- These output lines can be summarized as follows:
OK: *- Root: + <root>
- Compound:
ENVIRONMENT
- DICTIONARY
- Default dictionary to use, if no -d flag is given.
- WORDLIST
- Personal dictionary file name
- INCLUDE_STRING
- Code for file inclusion under the -A option
- TMPDIR Directory used for some of munchlist's temporary files
FILES
- !!LIBDIR!!/!!DEFHASH!!
- Hashed dictionary (may be found in some other local directory, depending on the system).
- !!LIBDIR!!/!!DEFLANG!!
- Affix-definition file for munchlist
- /usr/share/dict/web2 or /usr/share/dict/words
- For the Lookup function (depending on the WORDS compilation option).
- $HOME/.ispell_hashfile
- User's private dictionary
- .ispell_hashfile
- Directory-specific private dictionary
SEE ALSO
spell(1), egrep(1), look(1), join(1), sort(1), sq(1L), tib(1L),
ispell(5L), english(5L)
BUGS
It takes several to many seconds for ispell to read in the hash table,
depending on size.
When all options are enabled, ispell may take several seconds to generate all the guesses at corrections for a misspelled word; on slower
machines this time is long enough to be annoying.
The hash table is stored as a quarter-megabyte (or larger) array, so a
PDP-11 or 286 version does not seem likely.
Ispell should understand more troff syntax, and deal more intelligently
with contractions.
Although small personal dictionaries are sorted before they are written out, the order of capitalizations of the same word is somewhat random.
When the -x flag is specified, ispell will unlink any existing .bak
file.
There are too many flags, and many of them have non-mnemonic names.
Munchlist does not deal very gracefully with dictionaries which contain
"non-word" characters. Such characters ought to be deleted from the
dictionary with a warning message.
Findaffix and munchlist require tremendous amounts of temporary file
space for large dictionaries. They do respect the TMPDIR environment
variable, so this space can be redirected. However, a lot of the temporary space needed is for sorting, so TMPDIR is only a partial help on
systems with an uncooperative sort(1). ("Cooperative" is defined as
accepting the undocumented -T switch). At its peak usage, munchlist
takes 10 to 40 times the original dictionary's size in Kb. (The larger
ratio is for dictionaries that already have heavy affix use, such as
the one distributed with ispell). Munchlist is also very slow; munching a normal-sized dictionary (15K roots, 45K expanded words) takes
around an hour on a small workstation. (Most of this time is spent in
sort(1), and munchlist can run much faster on machines that have a more
modern sort that makes better use of the memory available to it.)
Findaffix is even worse; the smallest English dictionary cannot be processed with this script in a mere 50Kb of free space, and even after
specifying switches to reduce the temporary space required, the script
will run for over 24 hours on a small workstation.
AUTHOR
Pace Willisson (pace@mit-vax), 1983, based on the PDP-10 assembly version. That version was written by R. E. Gorin in 1971, and later
revised by W. E. Matson (1974) and W. B. Ackerman (1978).
Collected, revised, and enhanced for the Usenet by Walt Buehring, 1987.
Table-driven multi-lingual version by Geoff Kuenning, 1987-88.
Large dictionaries provided by Bob Devine (vianet!devine).
A complete list of contributors is too large to list here, but is distributed with the ispell sources in the file "Contributors".
VERSION
- The version of ispell described by this manual page is International
Ispell Version 3.1.00, 10/08/93.