[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Spelling correction

    Date: Mon, 20 Jan 86 13:56 EST
    From: David C. Plummer <DCP@SCRC-QUABBIN.ARPA>

	Date: Mon 20 Jan 86 09:48:22-PST
	From: Rene Bach <BACH@SU-SCORE.ARPA>


	My question is: why doesn't CL include a specification for a spelling
	correction function. The description of the Interlisp functions could be
	used as specification for the I/O. The choice of the algorithm could
	be left open.

    Base my following reaction on never having used Interlisp but only heard
    about it and some of its 'features.'

    The only 'spelling corrector' I've heard of in Interlisp is a DWIM
    facility to change the name of variables out from under you because you
    mistyped them.

Let me observe that there are several distinct things that may be desired:
(1) DETECTION of spelling errors
(2) CORRECTION of spelling errors.
(2) PREVENTION of spelling errors.
The correction process may proceed in different ways depending on how the
error was detected.  In some cases it is easier to prevent the error in the
first place.

The most general way in which spelling errors are "detected" is that a compiler
warning or interpreter error is issued, and maybe you get a debugging breakpoint.
This is not always the easiest way to correct the error.

The Symbolics implementation handles undefined variables and functions at top level
in a more useful way.  First of all, it looks around in other packages to see
whether a different symbol of the same name has the appropriate definition; if so,
it offers to make the substitution.  This is a kind of spelling correction (the
package name having been "misspelled").  Failing that, it prints a warning and
offers the opportunity to type a rubout or other input editor command rather than
having to go through the heavy-duty debugger.

Here at TMC we have an additional hack that allows the <complete> key to operate in
nearly all contexts, including the top level.  Frequently I need only type
R E N <complete> to get "RENAME-WITHIN-NEW-DEFINITION-MAYBE" on the screen.
This is spelling correction before the fact rather than after.

It would be easy, in a similar manner, to make <complete> (or Meta-$) examine the
previous word and apply a spelling-correction algorithm to it.  This is explicit
correction rather than implicit.

So there are many styles for dealing with the spelling problem.  I think
it would be premature to standardize on any one.