-->

Previous | Table of Contents | Next

Page 278

When in the _a mode, ispell will also accept lines of single words prefixed with any of the following: *, &, @, +, -, ~, #, !, %, or ^. A line starting with * tells ispell to insert the word into the user's dictionary (similar to the I command). A line starting with & tells ispell to insert an all-lowercase version of the word into the user's dictionary (similar to the U command). A line starting with @ causes ispell to accept this word in the future (similar to the A command). A line starting with +, followed immediately by tex or nroff, will cause ispell to parse future input according the syntax of that formatter. A line consisting solely of a + will place ispell in TeX/LaTeX mode (similar to the _t option) and - returns ispell to nroff/troff mode (but these commands are obsolete). However, string character type is not changed; the ~ command must be used to do this. A line starting with ~ causes ispell to set internal parameters (in particular, the default string character type) based on the filename given in the rest of the line. (A file suffix is sufficient, but the period must be included. Instead of a filename or suffix, a unique name, as listed in the language affix file, may be specified.) However, the formatter parsing is not changed; the + command must be used to change the formatter. A line prefixed with # will cause the personal dictionary to be saved. A line prefixed with ! will turn on terse mode (explained later in this subsection), and a line prefixed with % will return ispell to normal (non-terse) mode. Any input following the prefix characters +, -, #, !, or % is ignored, as is any input following the filename on a ~ line. 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 up arrow to protect themselves against future changes in ispell.

To summarize these:

* Add to personal dictionary
@ Accept word, but leave out of dictionary
# Save current personal dictionary
~ Set parameters based on filename
+ Enter TeX mode
- Exit TeX mode
! Enter terse mode
% Exit terse mode
^ Spell check rest of line

In terse mode, 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.

The _s option is only valid in conjunction with the _a or _A OPTIONS, and only on BSD-derived systems. If specified, ispell will stop itself with a SIGTSTP signal after each line of input. It will not read more input until it receives a SIGCONT signal. This may be useful for handshaking with certain text editors.

The _f option is only valid in conjunction with the _a or _A OPTIONS. If _f is specified, ispell will write its results to the given file, rather than to standard output.

The _v option causes ispell to print its current version identification on the standard output and exit. If the switch is doubled, ispell will also print the OPTIONS that it was compiled with.

The _c, _e[1-4], and _D OPTIONS of ispell are primarily intended for use by the munchlist shell script. The _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 munchlist script does this. As an example, the command


echo BOTHER | ispell -c

produces


BOTHER BOTHE/R BOTH/R

The _e switch is the reverse of _c; it expands affix flags to produce a list of words. For example, the command


echo BOTH/R | ispell -e

produces


BOTH BOTHER

Page 279

An optional expansion level can also be specified. A level of 1 (_e1) is the same as _e alone. A level of 2 causes the original root/affix combination to be prepended to the line:


BOTH/R BOTH BOTHER

A level of 3 causes multiple lines to be output, one for each generated word, with the original root/affix combination followed by the word it creates:


BOTH/R BOTH

BOTH/R BOTHER

A level of 4 causes a floating-point number to be appended to each of the level 3 lines, giving the ratio between the length of the root and the total length of all generated words including the root:


BOTH/R BOTH 2.500000

BOTH/R BOTHER 2.500000

Finally, the _D flag causes the affix tables from the dictionary file to be dumped to standard output.

Unless your system administrator has suppressed the feature to save space, 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 (such as George) and words that must be all capitals (such as NASA), it can also handle words with unusual capitalization (for example, IT-Corp 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.)

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 (for example, 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 will be considered a misspelling by 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.

The rules for capitalization are as follows:

  1. Any word may appear in all capitals, as in headings.
  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).
  3. Any word that has unusual capitalization (that is, 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.

buildhash

The buildhash program builds hashed dictionary FILES for later use by ispell. The raw word list (with affix flags) is given in dict-file, and the affix flags are defined by affix-file. The hashed output is written to hash-file. The FORMATS of the two input FILES are described in ispell(4). The _s (silent) option suppresses the usual status messages that are written to the standard error device.

munchlist

The 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 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.

Input for munchlist contains of raw words (such as those 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.

The _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.

The _v (verbose) option causes progress messages to be reported to stderr so you won't get nervous that munchlist has hung.

Previous | Table of Contents | Next