TYPO - check a text file for spelling mistakes (typos).

Syntax:

typo [options] filename [dictname] [dictname] ...
(+|-)Dictionary (+)         (+|-)Formatted (-)
(+|-)Lowercase (-)          +Type
(+|-)Verbose (-)            (+|-)Wordlist (-)

Options:

+Formatted
rejoins hyphenated words and uses lines starting with ".". To handle underscored and boldfaced words correctly, TYPO will reduce occurrences of either an underbar followed by a backspace or two identical characters with an intervening backspace; thus these characters are no longer underscored or boldfaced.
+Lowercase
forces words from "filename" to be lower case. This is handy for ignoring case distinctions when generating a word list.
-Dictionary
suppresses search of default dictionary.
+Type
indicates source files using TYPE or TPUB instead of TF (which means that lines beginning with "{" are taken to be formatting commands).
+Verbose
informs you as each dictionary is searched.
+Wordlist
makes a word list (implies "-Dictionary").

Examples:

typo myfile
typo +formatted myfile mydict

Description:

TYPO builds a tree in memory of unique words in the given file ("-" means standard input). Unless the "+Formatted" option is used, lines beginning with a "." (assumed to be TF commands) are thrown away. If the "+Formatted" option is used, lines ending in a "-" are assumed to have been hyphenated and are rejoined. The procedure works best with a small file.

It then reads the default dictionary (5700 words) and removes any entries in the tree which match words in the dictionary. If you supplied dictionaries, the same process is repeated on these also. Text file words which are hyphenated over a new line are reassembled into one word.

A user dictionary must be sorted in dictionary order. In dictionary order, upper case "A" precedes a lower case "a", which in turn precedes upper case "B". To establish the ordering, words are first compared with upper case alphabetics converted to lower case. If they are equal, a second compare is performed using the original case.

An upper case character in a dictionary may only match an upper case character in the input file. A lower case character may match either an upper or lower case character.

When done, all entries remaining in the tree are assumed to be spelling errors and dumped to the standard output unit. They are also dumped to the file "b.out" at the same time. With each entry printed is a count showing the number of times the word was found in the text file and the line number of its first occurrence.

The "+Wordlist" option (in addition to selecting the default dictionary) suppresses the printing of the frequency counts and line numbers in the output. This option is especially useful for generating lists of keywords in a document. It is also useful for sorting a list of words into dictionary order.

Larger Dictionary:

There is a larger dictionary available, containing about 31,000 words. It takes somewhat longer to check a file against this dictionary. To use it, specify the "-Dictionary" option and request that the file "wp/dicts/32k" be used. For example,

typo -d myfile wp/dicts/32k

Files Used:

wp/dicts/5.7k
b.out

Copyright © 1996, Thinkage Ltd.