Previous: , Up: Editing Documents   [Contents][Index]


4.5 Spelling Correction

Hemlock has a spelling correction facility based on the dictionary for the ITS spell program. This dictionary is fairly small, having only 45,000 word or so, which means it fits on your disk, but it also means that many reasonably common words are not in the dictionary. A correct spelling for a misspelled word will be found if the word is in the dictionary and is only erroneous in that it has a wrong character, a missing character, an extra character or a transposition of two characters.

Command: Check Word Spelling (bound to M-$)

This command looks up the previous or current word in the dictionary and attempts to correct the spelling if it is misspelled. There are four possible results of invoking this command:

  1. This command displays the message "Found it." in the echo area. This means it found the word in the dictionary exactly as given.
  2. This command displays the message "Found it because of word.", where word is some other word with the same root but a different ending. The word is no less correct than if the first message is given, but an additional piece of useless information is supplied to make you feel like you are using a computer.
  3. The command prompts with "Correction choice:" in the echo area and lists possible correct spellings associated with numbers in a pop-up display. Typing a number selects the corresponding correction, and the command replaces the erroneous word, preserving case as though by Query Replace. Typing anything else rejects all the choices.
  4. This commands displays the message "Word not found.". The word is not in the dictionary and possibly spelled correctly anyway. Furthermore, no similarly spelled words were found to offer as possible corrections. If this happens, it is worth trying some alternate spellings since one of them might be close enough to some known words that this command could display.
Command: Correct Buffer Spelling

This command scans the entire buffer looking for misspelled words and offers to correct them. It creates a window into the Spell Corrections buffer, and in this buffer it maintains a log of any actions taken by the user. When this finds an unknown word, it prompts for a key-event. The user has the following options:

a

Ignore this word. If the command finds the word again, it will prompt again.

i

Insert this word in the dictionary.

c

Choose one of the corrections displayed in the Spell Corrections window by specifying the correction number. If the same misspelling is encountered again, then the command will make the same correction automatically, leaving a note in the log window.

r

Prompt for a word to use instead of the misspelled one, remembering the correction as with c.

C-r

Go into a recursive edit at the current position, and resume checking when the recursive edit is exited.

After this command completes, it deletes the log window leaving the buffer around for future reference.

Hemlock Variable: Spell Ignore Uppercase (initial value nil)

If this variable is true, then Auto Check Word Spelling and Correct Buffer Spelling will ignore unknown words that are all uppercase. This is useful for acronyms and cryptic formatter directives.

Command: Add Word to Spelling Dictionary (bound to C-x $)

This command adds the previous or current word to the spelling dictionary.

Command: Remove Word from Spelling Dictionary

This command prompts for a word to remove from the spelling dictionary. Due to the dictionary representation, removal of a word in the initial spelling dictionary will remove all words with the same root. The user is asked for confirmation before removing a root word with valid suffix flags.

Command: List Incremental Spelling Insertions

This command displays the incremental spelling insertions for the current buffer’s associated spelling dictionary file.

Command: Read Spelling Dictionary

This command adds some words from a file to the spelling dictionary. The format of the file is a list of words, one on each line.

Command: Save Incremental Spelling Insertions

This command appends incremental dictionary insertions to a file. Any words added to the dictionary since the last time this was done will be appended to the file. Except for Augment Spelling Dictionary, all the commands that add words to the dictionary put their insertions in this list. The file is prompted for unless Set Buffer Spelling Dictionary has been executed in the buffer.

Command: Set Buffer Spelling Dictionary

This command Prompts for the dictionary file to associate with the current buffer. If the specified dictionary file has not been read for any other buffer, then it is read. Incremental spelling insertions from this buffer can be appended to this file with Save Incremental Spelling Insertions. If a buffer has an associated spelling dictionary, then saving the buffer’s associated file also saves any incremental dictionary insertions. The "Dictionary: file" file option may also be used to specify the dictionary for a buffer (see section file-options).

Hemlock Variable: Default User Spelling Dictionary (initial value nil)

This variable holds the pathname of a dictionary to read the first time Spell mode is entered in a given editing session. When Set Buffer Spelling Dictionary or the "dictionary" file option is used to specify a dictionary, this default one is read also. It defaults to nil.


Previous: Scribe Mode, Up: Editing Documents   [Contents][Index]