The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

spell - scan a file for misspelled words

SYNOPSIS

spell [ -b[dict]] [-c|-x] [-v] [-i] [-s dict] [ file ... ]

DESCRIPTION

spell reads in a file and splits it into words, then compares each unique word with a dictionary file (all comparisons and reporting are done in lower case). The "misspelled" words are printed on standard output.

The options are as follows:

-b

Use alternate dictionary (as specified in the variable at the top of the script, you should change this to represent your system).

-bfile

Use file as the alternate dictionary (notice no space between flag and file). This file is used instead of the standard dictionary. This could be a British spelling list, or for a different language.

-c

Check the dictionary for "close" matches. Each misspelled word will be followed by a list of indented close matches. A close match is one where it matches a word in the dictionary if 1 character is deleted, or 1 letter is added, or any 2 adjacent characters are swapped.

-x

Same as -c above.

-v

Show suffix expansion. Some words are inferred by modifying words in the dictionary, this shows you how that was done on some of your words, so you can double check if it did it right.

-i

Use interactively. Prompts for words, processes words after each line, instead of after whole file(s), and quit at first blank line (do not use on a file, this is for typing in words from standard in). Also prints descriptive titles and has a very basic pager.

-s file

Specify supplemental dictionary. This dictionary is used in addition to the base word list. The space before the file is optional. Multiple files can be used, but each needs its own -s flag.

Multiple flags can be combined, but -b and -s must come last, i.e. "spell -icvb" instead of "spell -i -c -v -b", and can be specified in any order.

If a file is not specified, it reads from standard input. Use the -i switch if you are going to type words in by hand.

SEE ALSO

ispell

/usr/dict/words

I did not create a word list, but found one without restriction (compiled for linux) at: ftp://ftp.cs.unc.edu/pub/users/faith/linux/linux.words.2.tar.gz.

RESTRICTIONS

This program is only as good as your word list (and maybe not that good, use the -v switch at least once). I did not compile the word list and cannot vouch for it. Remember this is a tool and not a replacement for your own thinking. Anyone who depends wholly on a spell checker without doing their own proofreading, deserves what they get (or worse), I accept no liability for any consequences of using this program.

This program only finds the misspelled words, it is up to you to decide if they are really wrong and replace them yourself.

My focus in writing this program was portability, therefore I did not use some things that may have speeded things up, however perl itself is quick enough that it still does pretty good even with the slower method.

BUGS

I know of no bugs at this time. There are a couple of things that may make it run a bit faster and the documentation may be made a little clearer.

AUTHOR

Gregory L. Snow, (Greg), snow@biostat.washington.edu

COPYRIGHT and LICENSE

This program is copyright (c) Gregory L. Snow 1999.

This program is free and open software. You may use, modify, or distribute this program (with or without modifications) to your hearts content. However I take no responsibility for your use or misuse of this program.