Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 +MULTI+2.11; site brueer.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!ukc!reading!brueer!holte From: holte@brueer.UUCP (Robert Holte) Newsgroups: net.sources Subject: Re: spellfix - interactive spelling checker and fixer Message-ID: <157@brueer.brueer.UUCP> Date: Sun, 28-Apr-85 19:10:09 EDT Article-I.D.: brueer.157 Posted: Sun Apr 28 19:10:09 1985 Date-Received: Tue, 30-Apr-85 04:15:26 EDT References: <10091@brl-tgr.ARPA> Organization: Dept of EE & E, Brunel University, Uxbridge, U.K. Lines: 41 Xpath: reading gateway.cs cs 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)