SpellingCorrection.mesa
Last edited by Nix at October 8, 1983 5:05 pm
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.