spellfix - interactive spelling checker and fixer

Robert Holte holte at brueer.UUCP
Mon Apr 29 09:10:09 AEST 1985


There is a small bug in the "spellfix" shell script, as distributed.
The sed commands (stored in $t3) are not being created in
a legal format.

The fix is to replace the following lines (32-33) in the original
  echo "/${word}/i\
.\\\" ### spell: ${word} %%%" >> $t3

with

  echo "/${word}/i\\" >> $t3
  echo ".\\\\\" ### spell: ${word} %%%" >> $t3


The author observes in the BUGS section of the man page that
	"spellfix" can insert more error lines than needed.
	For example, if "spell" rejects 'teache',
	lines with 'teacher' will be marked as erroneous.

This can be extremely inconvenient, and can largely be avoided by
using more selective sed patterns.  I suggest using all
of the following (instead of the bug fix just given):

  echo "/[^a-zA-Z]${word}[^a-zA-Z]/i\\" >> $t3
  echo ".\\\\\" ### spell: ${word} %%%" >> $t3

  echo "/[^a-zA-Z]${word}\$/i\\" >> $t3
  echo ".\\\\\" ### spell: ${word} %%%" >> $t3

  echo "/^${word}[^a-zA-Z]/i\\" >> $t3
  echo ".\\\\\" ### spell: ${word} %%%" >> $t3

  echo "/^${word}\$/i\\" >> $t3
  echo ".\\\\\" ### spell: ${word} %%%" >> $t3

Collectively, the four sed patterns created in this way pick out
all occurrences of "word" which are neither preceded nor
followed by a letter of the alphabet.  This is still not
perfect, but it is very much better than the original.

 -- Rob Holte     (...!ukc!reading!brueer!holte)



More information about the Comp.sources.unix mailing list