Files
oldlinux-files/Linux-0.98/Yggdrasil-0.98.3/usr/man/man1/ispell.1
2024-02-19 00:21:16 -05:00

1504 lines
43 KiB
Plaintext

.\" -*- Mode:Text -*-
.\"
.\" $Id: ispell.1,v 1.62 1992/01/04 22:08:15 geoff Exp $
.\"
.\" Copyright 1987, 1988, 1989, by Geoff Kuenning, Manhattan Beach, CA
.\" Permission for non-profit use is hereby granted.
.\" All other rights reserved.
.\" See "version.h" for a more complete copyright notice.
.\"
.\" $Log: ispell.1,v $
.\" Revision 1.62 1992/01/04 22:08:15 geoff
.\" Mention that tib(1L) references are now handled. Fix a typo in a
.\" switch name. Document the input format for munchlist.
.\"
.\" Revision 1.61 91/09/17 22:44:13 geoff
.\" Update version referenced.
.\"
.\" Revision 1.60 91/09/04 18:00:49 geoff
.\" Many changes to improve the man page: put variable information in
.\" italics. Format the synopsis better. Document what compilation
.\" options affect which defaults. Make a couple of tables use .IP so the
.\" format correctly with both nroff and troff. Talk about disk space in
.\" kilobytes and megabytes. Add some subheadings. Add the VERSION
.\" section.
.\"
.\" Revision 1.59 91/09/04 14:40:55 geoff
.\" Document the startup message in ask mode
.\"
.\" Revision 1.58 91/09/03 20:14:09 geoff
.\" Add documentation for the -vv switch.
.\"
.\" Revision 1.57 91/08/10 16:38:23 geoff
.\" Document the -V switch.
.\"
.\" Revision 1.56 91/08/10 14:09:29 geoff
.\" Fix a misuse of the .IP macro.
.\"
.\" Revision 1.55 91/07/27 21:40:17 geoff
.\" Document the new personal-dictionary behavior
.\"
.\" Revision 1.54 91/07/27 20:48:20 geoff
.\" Fix several tables to use ".IP" to generate them. Add documentation
.\" of the "u" command.
.\"
.\" Revision 1.53 91/07/15 19:26:54 geoff
.\" Document the fact that the -T switch now overrides the file suffix.
.\"
.\" Revision 1.52 91/07/05 16:48:31 geoff
.\" Change the askmode '$' flag to be '~', and add documention of the new
.\" askmode '^' flag.
.\"
.\" Revision 1.51 91/07/04 00:04:11 geoff
.\" Document the -c and -T options of munchlist.
.\"
.\" Revision 1.50 91/06/12 19:15:11 geoff
.\" Mention that munchlist doesn't handle non-word characters.
.\"
.\" Revision 1.49 91/05/27 21:35:33 geoff
.\" Document the -T option, and the '$' command to askmode. Fix a couple
.\" of minor typos.
.\"
.\" Revision 1.48 91/02/26 23:21:18 geoff
.\" Clarify the capitalization implications of the 'I' command
.\"
.\" Revision 1.47 90/10/05 02:24:09 geoff
.\" Document terse mode and the '-' output line
.\"
.\" Revision 1.46 90/09/04 01:12:20 geoff
.\" Change the summary lines to be usable with the BSD manual-searching
.\" commands, which expect a single line of description. (This was pointed
.\" out to me by somebody, but at the moment I've lost his name).
.\"
.\" Revision 1.45 89/12/27 22:26:45 geoff
.\" Document the -N and -W options. Clean up the description of IGNROEBIB
.\" a bit. Boldface a forgotten -x. Document the -f option, which had been
.\" forgotten.
.\"
.\" Revision 1.44 89/07/11 00:21:11 geoff
.\" Clean up the appearance of the environment and file lists. Based
.\" on changes made by luis@rice.edu.
.\"
.\" Revision 1.43 89/06/25 15:28:27 geoff
.\" Document the new version of findaffix. Fix a place where italics weren't
.\" used for emphasis. Get rid of the now-obsolete bug that ispell couldn't
.\" handle the ess-zed of German.
.\"
.\" Revision 1.42 89/04/28 01:09:44 geoff
.\" Change Header to Id; nobody cares about my pathnames.
.\"
.\" Revision 1.41 89/02/27 02:21:24 geoff
.\" Document the -M switch.
.\"
.\" Revision 1.40 89/02/22 23:13:04 geoff
.\" Document the new -L switch for controlling the context size. Also make
.\" sure all switches are always mentioned in boldface, and clarify a mildly
.\" confusing phrase.
.\"
.\" Revision 1.39 89/01/30 23:15:39 geoff
.\" Fix a place where a line started with a single quote, which is a bad
.\" idea (Ken Stevens).
.\"
.\" Revision 1.38 88/12/26 02:26:16 geoff
.\" Add a copyright notice. Move most of the contributors list to a
.\" separate file, due to its size.
.\"
.\" Revision 1.37 88/11/27 00:16:24 geoff
.\" Document the new options to findaffix. Interchange the 'q' and 'x'
.\" commands, as per the new code in ispell. Document the -s option.
.\" Note that the shell scripts have built-in documentation commentary.
.\" Add a couple of bugs (notably the ess-zed problem). Other minor cleanups.
.\"
.\" Revision 1.36 88/10/20 20:51:23 geoff
.\" Document the interaction of the -d switch with the personal dictionary
.\" name (Ole Bjoern Hessen).
.\"
.\" Revision 1.35 88/06/25 17:46:49 geoff
.\" Add documentation of all the new options: -n, -b, -B, -C, -P, and -m.
.\" Document latest changes to emacs mode. Rationalize the switch description
.\" a tiny bit.
.\"
.\"
.\" Revision 1.34 88/04/11 01:33:20 geoff
.\" Update the description of ask mode to reflect the new output format.
.\" Move Ken Stevens' name to its proper place. Add Ole Bjoern Hessen's name.
.\"
.\" Revision 1.33 88/04/10 20:48:53 geoff
.\" Integrate Ken Stevens' changes into the main branch
.\"
.\" Revision 1.32 88/04/03 23:15:32 geoff
.\" Remove the disclaimer about the -w option to munchlist; it no longer
.\" applies.
.\"
.\" Revision 1.31 88/03/27 00:58:15 geoff
.\" Document the -s option of buildhash. Add commentary about the history
.\" of the PDP-10 assembly version.
.\"
.\" Revision 1.30 88/03/13 15:29:08 geoff
.\" Minor corrections to the SEE ALSO entries; add see also sq
.\"
.\" Revision 1.29 88/03/12 02:43:21 geoff
.\" Some cleanups: Make the manpage go in section 1, local. Make the table
.\" of responses look a little nicer. Add a caveat about the -w option to
.\" munchlist.
.\"
.\" Revision 1.28 88/02/29 22:25:28 geoff
.\" Improve formatting, and update the documentation to reflect the
.\" latest changes (including tryaffix and the -c switch to buildhash).
.\"
.\" Revision 1.27 87/10/01 00:18:15 geoff
.\" Document the new "guess" mode. Add a name. Fix some out-of-date
.\" commentary about the -d switch. Change several "suffix"'es to "affix".
.\"
.\" Revision 1.26 87/09/13 14:04:50 geoff
.\" Add some changes from Michael Wester, also add another name
.\"
.\" Revision 1.25 87/09/09 00:16:48 geoff
.\" Add a comment about capitalization order to the bugs list, and a name
.\" to the authors list.
.\"
.\" Revision 1.24 87/09/03 23:00:23 geoff
.\" Add George M. Sipe's rewordings and improvements.
.\"
.\" Revision 1.23 87/08/28 21:20:05 geoff
.\" Update to reflect the new table-driven version. Also document
.\" buildhash and remove isexpand.
.\"
.\" Revision 1.22 87/06/27 12:18:59 geoff
.\" Minor changes and corrections from Michael Wester.
.\"
.\" Revision 1.21 87/06/07 16:01:44 geoff
.\" Remove a non-longer-existing bug, and add a few names.
.\"
.\" Revision 1.20 87/05/30 16:54:35 geoff
.\" Add some more names, plus a cross-reference to ispell(4).
.\"
.\" Revision 1.19 87/05/25 21:58:26 geoff
.\" Document the -v option.
.\"
.\" Revision 1.18 87/05/25 21:10:13 geoff
.\" Document Mark Davies' stuff, and the environment variables.
.\"
.\" Revision 1.17 87/05/25 15:25:43 geoff
.\" Add documentation of isexpand, the new capitalization features, backslashes
.\" in -w options. Fix some minor bugs and file name paths. Add some more
.\" names.
.\"
.\" Revision 1.16 87/04/01 23:13:32 geoff
.\" Put in Isaac Balbin's correct name
.\"
.\" Revision 1.15 87/04/01 13:06:12 geoff
.\" Document auto-TeX mode on .tex extensions. Add a bunch of new credits.
.\"
.\" Revision 1.14 87/03/29 01:58:03 geoff
.\" Credit David Neves
.\"
.\" Revision 1.13 87/03/29 00:59:11 geoff
.\" Credit Jim Knutson
.\"
.\" Revision 1.12 87/03/28 23:40:30 geoff
.\" Document how to complete single-digit numbers, and fix two spelling errors
.\"
.\" Revision 1.11 87/03/28 20:19:52 geoff
.\" Update the credit list
.\"
.\" Revision 1.10 87/03/28 20:01:36 geoff
.\" Change -T to -t (per Don Kark, among others)
.\"
.\" Revision 1.9 87/03/27 17:20:53 geoff
.\" Add the -T option to the summary. Document the -S option.
.\"
.\" Revision 1.8 87/03/23 00:26:30 geoff
.\" Give Don Kark bugfix credit
.\"
.\" Revision 1.7 87/03/22 23:48:52 geoff
.\" Add Greg Shaffer's -T stuff, also credit Dave Mason
.\"
.\" Revision 1.6 87/03/22 23:15:37 geoff
.\" Integrate Perry Smith's changes into the main branch; also give
.\" Walt Buehring proper credit.
.\"
.\" Revision 1.5 87/03/13 22:38:07 geoff
.\" Add documentation of munchlist's -d option.
.\"
.\" Revision 1.4 87/03/08 20:30:54 geoff
.\" Add documentation of -c switch and munchlist; also clean up a bit.
.\"
.\" Revision 1.3 87/02/26 00:28:38 geoff
.\" Integrate McQueer's enhancements into the main branch
.\"
.\" Revision 1.2 87/01/17 13:12:35 geoff
.\" Add RCS ID keywords
.\"
.\"
.TH ISPELL 1 local
.SH NAME
ispell, buildhash, munchlist, findaffix, tryaffix \- Interactive
spelling checking
.SH SYNOPSIS
.B ispell
.RI [ common-flags ]
.RB [ \-M | \-N ]
.RB [ \-L \fIcontext\fP ]
.RB [ \-V ]
files
.br
.B ispell
.RI [ common-flags ]
.B \-l
.br
.B ispell
.RI [ common-flags ]
.RB [ \-f
file]
.RB [ \-s ]
.RB { \-a | \-A }
.br
.B ispell
.RB [ \-d
.IR file ]
.RB [ \-w
.IR chars ]
.B \-c
.br
.B ispell
.RB [ \-d
.IR file ]
.RB [ \-w
.IR chars ]
.BR \-e [ e ]
.br
.B ispell
.RB [ \-d
.IR file ]
.B \-D
.br
.B ispell
.BR \-v [ v ]
.IP \fIcommon-flags\fP:
.RB [ \-t ]
.RB [ \-n ]
.RB [ \-b ]
.RB [ \-x ]
.RB [ \-B ]
.RB [ \-C ]
.RB [ \-P ]
.RB [ \-m ]
.RB [ \-S ]
.RB [ \-d
.IR file ]
.RB [ \-p
.IR file ]
.RB [ \-w
.IR chars ]
.RB [ \-W
.IR n ]
.RB [ \-T
.IR type ]
.PP
.B buildhash
.RB [ \-s ]
.I
dict-file affix-file hash-file
.br
.B buildhash
.B \-c
.I
count affix-file
.if n .TP 10
.if t .PP
.B munchlist
.RB [ \-l
.IR aff-file ]
.RB [ \-c
.IR conv-file ]
.RB [ \-T
.IR suffix ]
.if n .br
.RB [ \-s
.IR hash-file ]
.RB [ \-D ]
.RB [ \-w
.IR chars ]
.RI [ files ]
.if n .TP 10
.if t .PP
.B findaffix
.RB [ \-p | \-s ]
.RB [ \-f ]
.RB [ \-c ]
.RB [ \-m
.IR min ]
.RB [ \-M
.IR max ]
.RB [ \-e
.IR elim ]
.if n .br
.RB [ \-t
.IR tabchar ]
.RB [ \-l
.IR low ]
.RI [ files ]
.PP
.B tryaffix
.RB [ \-p | \-s]
.RB [ \-c ]
.I expanded-file
.IR affix [ +addition ]
...
.SH DESCRIPTION
.PP
.I Ispell
is fashioned after the
.I spell
program from ITS (called
.I ispell
on Twenex systems.) The most common usage is "ispell filename". In this
case,
.I 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):
.PP
.RS
.IP R
Replace the misspelled word completely.
.IP Space
Accept the word this time only.
.IP A
Accept the word for the rest of this
.I ispell
session.
.IP I
Accept the word, capitalized as it is in the
file, and update private dictionary.
.IP U
Accept the word, and add an uncapitalized (actually, all lower-case)
version to the private dictionary.
.IP 0-\fIn\fR
Replace with one of the suggested words.
.IP L
Look up words in system dictionary (controlled by the WORDS
compilation option).
.IP X
Write the rest of this file, ignoring misspellings, and start next file.
.IP Q
Exit immediately and leave the file unchanged.
.IP !
Shell escape.
.IP ^L
Redraw screen.
.IP ^Z
Suspend ispell.
.IP ?
Give help screen.
.RE
.PP
If the
.B \-M
switch is specified,
a one-line mini-menu at the bottom of the screen will
summarize these options.
Conversely, the
.B \-N
switch may be used to suppress the mini-menu.
(The minimenu is displayed by default if
.I ispell
was compiled with the MINIMENU option,
but these two switches will always override the default).
.PP
If the
.B \-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.
.PP
If the
.B \-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
.I ispell
thinks that these characters are legal ISO Latin-1 on your system.
This is useful when working with older terminals.
Without this switch,
.I ispell
will display 8-bit characters "as is" if they have been defined as
string characters for the chosen file type.
.PP
"Normal" mode, as well as the
.BR \-l ,
.BR \-a ,
and
.B \-A
options (see below) also
accepts the following "common" flags on the command line:
.RS
.IP \fB\-t\fR
The input file is in TeX or LaTeX format.
.IP \fB\-n\fR
The input file is in nroff/troff format.
.IP \fB\-b\fR
Create a backup file by appending ".bak"
to the name of the input file.
.IP \fB\-x\fR
Don't create a backup file.
.IP \fB\-B\fR
Report run-together words with missing blanks as spelling errors.
.IP \fB\-C\fR
Consider run-together words as legal compounds.
.IP \fB\-P\fR
Don't generate extra root/affix combinations.
.IP \fB\-m\fR
Make possible root/affix combinations that
aren't in the dictionary.
.IP \fB\-S\fR
Sort the list of guesses by probable correctness.
.IP "\fB\-d\fR file"
Specify an alternate dictionary file.
.IP "\fB\-p\fR file"
Specify an alternate personal dictionary.
.IP "\fB\-w\fR chars"
Specify additional characters that can be part of a word.
.IP "\fB\-W\fR n"
Specify length of words that are always legal.
.IP "\fB-T\fR type"
Assume a given formatter type for all files.
.RE
.PP
The
.B \-n
and
.B \-t
options select whether
.I ispell
runs in nroff/troff
.RB ( \-n )
or TeX/LaTeX
.RB ( \-t )
input mode.
(The default is controlled by the DEFTEXFLAG installation option.)
TeX/LaTeX mode is also automatically selected if an input file has
the extension ".tex".
In TeX/LaTeX mode, whenever a backslash ("\e") is found,
.I 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 \ecite command, since they contain arbitrary,
non-word arguments. Spell checking is also suppressed when in math mode.
Thus, for example, given
.PP
.RS
\echapter {This is a Ckapter}
\ecite{SCH86}
.RE
.PP
.I ispell
will find "Ckapter" but not "SCH".
The
.B \-t
option does not recognize the TeX comment character "%", so comments are
also spell-checked.
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
.I ispell
was compiled with
.B IGNOREBIB
defined. Otherwise, the bibliography will be checked but the reference
key will not.
.PP
References for the
.IR tib (1)
bibliography system, that is, text between a ``[.'' or ``<.'' and
``.]'' or ``.>'' will always be ignored in TeX/LaTeX mode.
.PP
The
.B \-b
and
.B \-x
options control whether
.I 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
.B \-x
option.
The default for this option is controlled by the DEFNOBACKUPFLAG
installation option.
.PP
The
.B \-B
and
.B \-C
options control how
.I ispell
handles run-together words, such as "notthe" for "not the".
If
.B \-B
is specified, such words will be considered as errors, and
.I ispell
will list variations with an inserted blank or hyphen as possible
replacements.
If
.B \-C
is specified, run-together words will be considered to be
legal compounds as long as both components are in the dictionary, and
neither component is a single character.
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 two 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.
.PP
The
.B \-P
and
.B \-m
options control when
.I 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
.B \-P
is specified, such guesses are displayed only if
.I ispell
cannot generate any possibilities that match the current dictionary.
If
.B \-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.
.PP
The
.B \-S
option suppresses
.IR 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 low-numbered.
.PP
The
.B \-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
.IR ispell ,
a dictionary of
.IR /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").
.PP
The
.B \-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 you specify one of the default hash-files from the library
dictionary and the file ".ispell_\fIhashfile\fR" exists, ispell will use this
file as the personal dictionary. If none of these conditions are met, the
file ".ispell_words" is used.
(These variables and defaults may be overridden by the installation
options PDICTVAR, DEFPDICT, and DEFPAFF, but this is not recommended.)
.PP
If the
.B \-p
option is
.I not
specified,
.I 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.
.PP
You are advised to create the file "~/.ispell_\fIhashfile\fR" if you want to use
.I ispell
on several different languages. For example, in Norway the file
".ispell_norsk" is used as the personal Norwegian dictionary and the file
".ispell_english" or
".ispell_words" for the personal English dictionary.
.PP
The
.B \-w
option may be used to specify characters other than alphabetics
which may also appear in words. For instance,
.B \-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., "\e014" 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):
.PP
.RS
n007n012
.RE
.PP
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.
.I 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.
.PP
The
.B \-W
option may be used to change the length of words that
.I ispell
always accepts as legal.
Normally,
.I ispell
will accept all 1-character words as legal, which is equivalent to
specifying "\fB\-W 1\fR."
(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 "\fB\-W 0\fR."
On the other hand, if your document specifies a lot of three-letter acronyms,
you would specify "\fB\-W 3\fR" to accept all words of three letters or
less.
Regardless of the setting of this option,
.I 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.
.PP
The
.B \-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.
If no
.B \-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.
.PP
The
.B \-l
or "list" option to
.I ispell
is used to produce a list of misspelled words from the standard input.
.PP
The
.B \-a
option
is intended to be used from other programs through a pipe. In this
mode,
.I 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
.B \-C
option), then the line contains only a '\-'.
.PP
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:
.PP
.RS
[prefix+] root [-prefix] [-suffix] [+suffix]
.RE
.PP
(e.g., "re+fry-y+ies" to get "refries")
where each optional
.I pfx
and
.I 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.
.PP
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
.I ispell
has completed processing the input line.
.PP
These output lines can be summarized as follows:
.PP
.RS
.IP OK:
*
.IP Root:
+ <root>
.IP Compound:
\-
.IP Miss:
& <original> <count> <offset>: <miss>, <miss>, ..., <guess>, ...
.IP Guess:
? <original> 0 <offset>: <guess>, <guess>, ...
.IP None:
# <original> <offset>
.RE
.PP
For example, a dummy dictionary containing the words "fray", "Frey",
"fry", and "refried" might produce the following response to the
command "echo 'frqy refries | ispell -a -m -d ./test.hash":
.RS
.nf
(#) International Ispell Version 3.0.05 (beta), 08/10/91
& frqy 3 0: fray, Frey, fry
& refries 1 5: refried, re+fry-y+ies
.fi
.RE
.PP
This mode
is also suitable for interactive use when you want to figure out the
spelling of a single word.
.PP
The
.B \-A
option works just like
.BR \-a ,
except that if a line begins with the string "&Include_File&", the rest
of the line is taken as the name of a file to read for further words.
Input returns to the original file when the include file is exhausted.
Inclusion may be nested up to five deep.
The key string may be changed with the environment variable
.B INCLUDE_STRING
(the ampersands, if any, must be included).
.PP
When in the
.B \-a
mode,
.I ispell
will also accept lines of single words prefixed with any
of '*', '@', '+', '-', '~', '#', '!', '%', or '^'.
A line starting with '*' tells
.I ispell
to insert the word into the user's dictionary (similar to the I command).
A line starting with '@' causes
.I ispell
to accept this word in the future (similar to the A command).
A line prefixed with a '+' will place
.I ispell
in TeX/LaTeX mode (similar to the
.B \-t
option) and '-' returns
.I ispell
to nroff/troff mode.
A line starting with '~' causes
.I ispell
to set internal parameters (in particular, the default string
character type) based on the filename given in the rest of the line.
A line prefixed with '#' will cause the
personal dictionary to be saved.
A line prefixed with '!' will turn on
.I terse
mode (see below), and a line prefixed with '%' will return
.I ispell
to normal (non-terse) mode.
Any input following the prefix
characters '+', '-', '~', '#', '!', or '%' is ignored.
To allow spell-checking of lines beginning with these characters, a
line starting with '^' has that character removed before it is passed
to the spell-checking code.
It is recommended that programmatic interfaces prefix every data line
with an uparrow to protect themselves against future changes in
.IR ispell .
.PP
To summarize these:
.PP
.RS
.IP *
Add to personal dictionary
.IP @
Accept word, but leave out of dictionary
.IP #
Save current personal dictionary
.IP ~
Set parameters based on filename
.IP +
Enter TeX mode
.IP -
Exit TeX mode
.IP !
Enter terse mode
.IP %
Exit terse mode
.IP ^
Spell-check rest of line
.fi
.RE
.PP
In
.I terse
mode,
.I ispell
will not print lines beginning with '*', '+', or '\-', all of which
indicate correct words.
This significantly improves running speed when the driving program is
going to ignore correct words anyway.
.PP
The
.B \-s
option is only valid in conjunction with the
.B \-a
or
.B \-A
options, and only on BSD-derived systems.
If specified,
.I ispell
will stop itself with a
.B SIGTSTP
signal after each line of input.
It will not read more input until it receives a
.B SIGCONT
signal.
This may be useful for handshaking with certain text editors.
.PP
The
.B \-f
option is only valid in conjunction with the
.B \-a
or
.B \-A
options.
If
.B \-f
is specified,
.I ispell
will write its results to the given file, rather than to standard output.
.PP
The
.B \-v
option causes
.I ispell
to print its current version identification on the standard output
and exit.
If the switch is doubled,
.I ispell
will also print the options that it was compiled with.
.PP
The
.BR \-c ,
.BR \-e [ e ],
and
.B \-D
options of
.IR ispell ,
and the
.B \-c
option of
.IR buildhash ,
are primarily intended for use by the
.I munchlist
shell script.
The
.B \-c
switch causes a list of words to be read from the standard input.
For each word, a list of possible root words and affixes will be
written to the standard output.
Some of the root words will be illegal and must be filtered from the
output by other means;
the
.I munchlist
script does this.
As an example, the command:
.PP
.RS
echo BOTHER | ispell -c
.RE
.PP
produces:
.PP
.RS
.nf
BOTHER BOTHE/R BOTH/R
.fi
.RE
.PP
The
.B \-e
switch is the reverse of
.BR \-c ;
it expands affix flags to produce a list of words.
For example, the command:
.PP
.RS
echo BOTH/R | ispell -e
.RE
.PP
produces:
.PP
.RS
.nf
BOTH BOTHER
.fi
.RE
.PP
If the
.B \-e
switch is doubled
.RB ( \-ee ),
then the original line is output as well:
.PP
.RS
.nf
BOTH/R BOTH BOTHER
.fi
.RE
.PP
Finally, the
.B \-D
flag causes the affix tables from the dictionary file
to be dumped to standard output.
.PP
Unless it has been installed without the CAPITALIZATION option
by your system administrator,
.I ispell
is aware of the correct capitalizations of words in the dictionary and
in your personal dictionary.
As well as recognizing words that must be capitalized (e.g., George) and
words that must be all-capitals (e.g., NASA), it can also handle words
with "unusual" capitalization (e.g., "ITCorp" or "TeX").
If a word is capitalized incorrectly, the list of possibilities will
include all acceptable capitalizations.
(More than one capitalization may be acceptable;
for example, my dictionary lists both "ITCorp" and "ITcorp".)
.PP
Normally, this feature will not cause you surprises, but there is one
circumstance you need to be aware of.
If you use "I" to
add a word to your dictionary that is at the beginning of a sentence
(e.g., the first word of this paragraph if "normally" were not in the
dictionary), it will be marked as "capitalization required".
A subsequent usage of this word without capitalization (e.g., the quoted word
in the previous sentence) will be considered a misspelling by
.IR ispell ,
and it will suggest the capitalized version.
You must then compare the actual spellings by eye, and then type "I"
to add the uncapitalized variant to your personal dictionary.
You can avoid this problem by using "U" to add the original word,
rather than "I".
.PP
The rules for capitalization are as follows:
.IP (1)
Any word may appear in all capitals, as in headings.
.IP (2)
Any word that is in the dictionary in all-lowercase form may appear
either in lowercase or capitalized (as at the beginning of a sentence).
.IP (3)
Any word that has "funny" capitalization (i.e., it contains both cases
and there is an uppercase character besides the first) must appear
exactly as in the dictionary, except as permitted by rule (1).
If the word is acceptable in all-lowercase, it must appear thus in a
dictionary entry.
.SH buildhash
The
.I buildhash
program builds hashed dictionary files for later use by
.I ispell.
The raw word list (with affix flags) is given in
.IR dict-file ,
and the the affix flags are defined by
.IR affix-file .
The hashed output is written to
.IR hash-file .
The formats of the two input files are described in
.IR ispell (4).
The
.B \-s
(silent) option suppresses the usual status messages that are written
to the standard error device.
.PP
The
.B \-c
option to
.I buildhash
is used to combine various affixes for the same root word.
The affixes are defined in
.IR affix-file .
The
.I count
given with the
.B \-c
option is an approximation of the number of root words in the
dictionary;
an accurate count is not necessary but speeds the operation.
Roots and affixes are read from standard input in the normal dictionary
format;
they need not be sorted.
All affixes for a given root will be combined, and the resulting
word list will be written (in an essentially random order unrelated
to the input order) to standard output.
For example, the command:
.PP
.RS
buildhash -c 3 english.aff << DONE
brother/S
sister/S
sister/M
brother/M
love/S
love/G
love/R
DONE
.RE
.PP
produces:
.PP
.RS
.nf
brother/MS
sister/MS
love/GRS
.fi
.RE
.PP
(though not necessarily in that order).
.SH munchlist
The
.I munchlist
shell script is used to reduce the size of dictionary files,
primarily personal dictionary files.
It is also capable of combining dictionaries from various sources.
The given
.I files
are read (standard input if no arguments are given),
reduced to a minimal set of roots and affixes that will match the
same list of words, and written to standard output.
.PP
Input for munchlist contains of raw words (e.g from your personal
dictionary files) or root and affix combinations (probably generated
in earlier munchlist runs). Each word or root/affix combination must
be on a separate line.
.PP
The
.B \-D
(debug) option leaves temporary files around under standard names instead
of deleting them, so that the script can be debugged.
Warning:
this option can eat up an enormous amount of temporary file space.
.PP
If the
.B \-s
(strip) option is specified, words that are in the specified
.I hash-file
are removed from the word list.
This can be useful with personal dictionaries.
.PP
The
.B \-l
option can be used to specify an alternate
.I affix-file
for munching dictionaries in languages other than English.
.PP
The
.B \-c
option can be used to convert dictionaries that were built with an
older affix file, without risk of accidentally introducing unintended
affix combinations into the dictionary.
.PP
The
.B \-T
option allows dictionaries to be converted to a canonical
string-character format.
The suffix specified is looked up in the affix file
.RB ( \-l
switch)
to determine the string-character format used for the input file;
the output always uses the canonical string-character format.
For example, a dictionary collected from TeX source files might be
converted to canonical format by specifying
.BR "\-T tex" .
.PP
The
.B \-w
option is passed on to
.IR ispell .
.SH findaffix
The
.I findaffix
shell script is an aid to writers of new language descriptions in choosing
affixes.
The given dictionary
.I files
(standard input if none are given) are examined for possible prefixes
.RB ( \-p
switch) or suffixes
.RB ( \-s
switch, the default).
Each commonly-occurring affix is presented along with
a count of the number of times it appears
and an estimate of the number of bytes that would be saved in a dictionary
hash file if it were added to the language table.
Only affixes that generate legal roots (found in the original input)
are listed.
.PP
If the "-c" option is not given, the output lines are in the
following format:
.IP
strip/add/count/bytes
.PP
where
.I strip
is the string that should be stripped from a root
word before adding the affix,
.I add
is the affix to be added,
.I count
is a count of the number of times that this
.IR strip / add
combination appears, and
.I bytes
is an estimate of the number of bytes that
might be saved in the raw dictionary file if this combination is
added to the affix file.
The field separator in the output will
be the tab character specified by the
.B -t
switch; the default is a slash ("/").
.PP
If the
.B \-c
("clean output") option is given, the appearance of
the output is made visually cleaner (but harder to post-process)
by changing it to:
.IP
-strip+add<tab>count<tab>bytes
.PP
where
.IR strip ,
.IR add ,
.IR count ,
and
.I bytes
are as before, and
.I "<tab>"
represents the ASCII tab character.
.PP
The method used to generate possible affixes will also generate
longer affixes which have common headers or trailers. For example,
the two words "moth" and "mother" will generate not only the obvious
substitution "+er" but also "-h+her" and "-th+ther" (and possibly
even longer ones, depending on the value of
.IR min ).
To prevent
cluttering the output with such affixes, any affix pair that shares
a common header (or, for prefixes, trailer) string longer than
.I elim
characters (default 1) will be suppressed.
You may want to set "elim" to a value greater than 1 if your language has string
characters;
usually the need for this parameter will become obvious
when you examine the output of your
.I findaffix
run.
.PP
Normally, the affixes are sorted according to the estimate of bytes saved.
The
.B \-f
switch may be used to cause the affixes to be sorted by frequency of
appearance.
.PP
To save output file space,
affixes which occur fewer than 10 times are eliminated;
this limit may be changed with the
.B \-l
switch.
The
.B \-M
switch specifies a maximum affix length (default 8).
Affixes longer than this will not be reported.
(This saves on temporary disk space and makes the script run faster.)
.PP
Affixes which generate stems shorter than 3 characters are suppressed.
(A stem is the word after the
.I strip
string has been removed, and before the
.I add
string has been added.)
This reduces both the running time and the size of the output file.
This limit may be changed with the
.B \-m
switch.
The minimum stem length should only be set to 1 if you have a
.I lot
of free time and disk space (in the range of many days and hundreds of
megabytes).
.PP
The
.I findaffix
script requires a non-blank field-separator character for internal
use.
Normally, this character is a slash ("/"), but if the slash
appears as a character in the input word list, a different character
can be specified with the
.B \-t
switch.
.PP
Ispell dictionaries should be expanded before being fed to
.IR findaffix ;
in addition, characters that are not in the English alphabet (if any) should
be translated to lowercase.
.SH tryaffix
The
.I tryaffix
shell script is used to estimate the effectiveness of a proposed
prefix
.RB ( \-p
switch) or suffix
.RB ( \-s
switch, the default) with a given
.IR expanded-file .
Only one affix can be tried with each execution of
.IR tryaffix ,
although multiple arguments can be used to describe varying forms of the
same affix flag (e.g., the
.B D
flag for English can add either
.I D
or
.I ED
depending on whether a trailing E is already present).
Each word in the expanded dictionary that ends (or begins) with the chosen
suffix (or prefix) has that suffix (prefix) removed;
the dictionary is then searched for root words that match the stripped word.
Normally, all matching roots are written to standard output, but if the
.B \-c
(count) flag is given, only a statistical summary of the results is written.
The statistics given are a count of words the affix potentially applies to
and an estimate of the number of dictionary bytes that a flag using the
affix would save.
The estimate will be high if the flag generates words
that are currently generated by other affix flags
(e.g., in English,
.I bathers
can be generated by either
.I bath/X
or
.IR bather/S ).
.P
The dictionary file,
.IR expanded-file ,
must already be expanded (using the
.B \-e
switch of
.IR ispell )
and sorted, and things will usually work best if uppercase
has been folded to lower with 'tr'.
.PP
The
.I affix
arguments are things to be stripped from the dictionary
file to produce trial roots:
for English,
.I con
(prefix) and
.I ing
(suffix) are examples.
The
.I addition
parts of the argument are letters that would have
been stripped off the root before adding the affix.
For example, in English the affix
.I ing
normally strips
.I e
for words ending in that letter (e.g.,
.I like
becomes
.IR liking )
so we might run:
.PP
.RS
.nf
tryaffix ing ing+e
.fi
.RE
.PP
to cover both cases.
.PP
All of the shell scripts contain documentation as commentary at the
beginning;
sometimes these comments contain useful information beyond the scope
of this manual page.
.PP
It is possible to install
.I ispell
in such a way as to only support ASCII range text if desired.
.SH ENVIRONMENT
.IP WORDLIST
Personal dictionary file name
.IP INCLUDE_STRING
Code for file inclusion under the -A option
.IP TMPDIR
Directory used for some of munchlist's temporary files
.SH FILES
.IP /usr/public/lib/english.hash
Hashed dictionary (may be found in some other local directory,
depending on the system).
.IP /usr/public/lib/english.aff
Affix-definition file for
.I munchlist
.IP "/usr/dict/web2 or /usr/dict/words"
For the Lookup function (depending on the WORDS compilation option).
.IP $HOME/.ispell_words
User's private dictionary
.IP .ispell_words
Directory-specific private dictionary
.SH SEE ALSO
spell(1), egrep(1), look(1), sq(1L), tib(1L), ispell(4L), english(4L)
.SH BUGS
It takes several to many seconds for
.I ispell
to read in the hash table, depending on size.
.sp
When all options are enabled,
.I 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.
.sp
The hash table is stored as a quarter-megabyte (or larger) array, so a PDP-11
or 286 version does not seem likely.
.sp
.I Ispell
should understand more
.I troff
syntax, and deal more intelligently with contractions.
.sp
Although small personal dictionaries are sorted before they are written out,
the order of capitalizations of the same word is somewhat random.
.sp
When the
.B \-x
flag is specified,
.I ispell
will unlink any existing .bak file.
.sp
There are too many flags, and many of them have non-mnemonic names.
.sp
.I 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.
.sp
.I Findaffix
and
.I 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
.IR sort (1).
("Cooperative" is defined as accepting the undocumented -T switch).
At its peak usage,
.I 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
.IR ispell ).
.I 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
.IR sort (1),
and
.I munchlist
can run much faster on machines that have a more modern
.I sort
that makes better use of the memory available to it.)
.I 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.
.SH 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).
.P
Collected, revised, and enhanced for the Usenet by Walt Buehring, 1987.
.P
Table-driven multi-lingual version by Geoff Kuenning, 1987-88.
.P
Large dictionaries provided by Bob Devine (vianet!devine).
.P
A complete list of contributors is too large to list here, but is
distributed with the ispell sources in the file "Contributors".
.SH VERSION
The version of ispell described by this manual page is
International Ispell Version 3.0.06 (beta), 09/17/91.