Next: File Utilities, Previous: Slave Lisps, Up: Auxiliary Systems [Contents][Index]
Hemlock supports spelling checking and correcting commands based on the ITS Ispell dictionary. These commands use the following routines which include adding and deleting entries, reading the Ispell dictionary in a compiled binary format, reading user dictionary files in a text format, and checking and correcting possible spellings.
This reads the default binary Ispell dictionary. Users must call this before the following routines will work.
This adds entries to the dictionary from the lines in the file filename. Dictionary files contain line oriented records like the following:
entry1/flag1/flag2 entry2 entry3/flag1
The flags are the Ispell flags indicating which endings are appropriate for the given entry root, but these are unnecessary for user dictionary files. You can consult Ispell documentation if you want to know more about them.
This takes a line from a dictionary file, and adds the entry described by line to the dictionary. Word-end defaults to the position of the first slash character or the length of the line. Line is destructively modified.
This removes entry, a simple-string, from the dictionary, so it will be an unknown word. This destructively modifies entry. If it is a root word, then all words derived with entry and its flags will also be deleted. If entry is a word derived from some root word, then the root and any words derived from it remain known words.
This checks the spelling of word and outputs the results. If this finds word is correctly spelled due to some appropriate suffix on a root, it generates output indicating this. If this finds word as a root entry, it simply outputs that it found word. If this cannot find word at all, then it outputs possibly correct close spellings. This writes to standard-output, and it calls maybe-read-spell-dictionary before attempting any lookups.
This returns an index into the dictionary if it finds word or an appropriate root. Word-len must be inclusively in the range 2 through max-entry-length, and it is the length of word. Word must be uppercase. This returns a second value indicating whether it found word due to a suffix flag, nil if word is a root entry.
This returns a copy of the root word at dictionary entry index. This index is the same as returned by spell-try-word.
This returns a list of words correctly spelled that are close to word. Word must be uppercase, and its length must be inclusively in the range 2 through max-entry-length. Close words are determined by the Ispell rules:
This returns a list of suffix flags as capital letters that apply to the dictionary root entry at index. This index is the same as returned by spell-try-word.
Next: File Utilities, Previous: Slave Lisps, Up: Auxiliary Systems [Contents][Index]