SpellingCorrection.mesa
Copyright Ó 1987, 1992 by Xerox Corporation. All rights reserved.
Last edited by Nix at October 8, 1983 5:05 pm
Tim Diebert: January 26, 1987 4:49:59 pm PST
DIRECTORY
Rope USING [ROPE];
SpellingCorrection: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
BruteForceCorrection:
PROC [word: ROPE, f: PROC [REF TEXT] RETURNS [BOOL], buffer: REF TEXT]
RETURNS [corrections: LIST OF ROPE, newBuffer: REF TEXT];
Generates all words close to "word" and returns a list of those for which f returns TRUE. The generation of close words proceeds in the usual brute-force manner: transpositions of adjacent letters in the word are considered first, then deletions of single letters, then insertions of single letters from 'a to 'z, and finally replacement of single letters by one of the other twenty five letters between 'a and 'z. The corrections proposed try to mimic the same capitalization style of the root word.
END.