🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.sources.bugs
Article #952

ispell incorrectly handles plurals (or is that plurales?)

#952
From: geoff
Date: Sat, 28 Feb 1987 09:16
107 lines
3634 bytes
Well, that didn't take as long as I thought it was going to.  As I said
before, disregard Bill Randle's latest bug fix (the one for "activityes").
Instead, apply this one.  It also incorporates the mask typo Bill found.

Problem:  ispell.c has a typo in a mask (0x7 instead of 0x7f).

Problem:  ispell.c issues the egrep command with "-i", instead of leaving it
	  to EGREPCMD in config.h, causing problems if you don't have -i.

Problem:  good.c incorrectly thinks "es" is an acceptable pluralization for
	  just about any word, instead of limiting it to those ending
	  in S, X, Z, or H.

Fix:	  Run this article through patch.  From rn, type "|patch -d dir",
	  where dir is the directory where you have ispell.  From other
	  newsreaders, save it in a file and type "patch -d dir < file".
	  If your egrep has the -i switch, you will also have to
	  modify EGREPCMD in config.h to include the -i switch there.
	  I don't include a patch for that.

Index: good.c

*** good.c.old	Sat Feb 28 01:06:31 1987
--- good.c	Sat Feb 28 01:06:34 1987
***************
*** 392,398
  		return;
  	case 'E': /* S (except simple adding of an S) */
  		p[-2] = 0;	/* drop the ES */
! 		if ((dent = lookup (w, strlen (w))) != NULL) {
  			if (dent->s_flag)
  				wordok = 1;;
  			return;

--- 395,402 -----
  		return;
  	case 'E': /* S (except simple adding of an S) */
  		p[-2] = 0;	/* drop the ES */
! 		if (index ("SXZH", p[-3]) != NULL
! 		    && (dent = lookup (w, strlen (w))) != NULL) {
  			if (dent->s_flag)
  				wordok = 1;;
  			return;


Index: ispell.c

*** ispell.c.old	Sat Feb 28 01:06:52 1987
--- ispell.c	Sat Feb 28 01:06:56 1987
***************
*** 206,212
  		case 'w':
  			num[3] = '\0';
  #ifdef NO8BIT
! 			mask = 0x7;
  #else
  			mask = 0xff;
  #endif

--- 210,216 -----
  		case 'w':
  			num[3] = '\0';
  #ifdef NO8BIT
! 			mask = 0x7f;
  #else
  			mask = 0xff;
  #endif
***************
*** 885,891
  #ifdef LOOK
  		if (wild)
  			/* string has wild card characters */
! 			sprintf (cmd, "%s -i '^%s$' %s", EGREPCMD, grepstr, WORDS);
  		else
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);

--- 889,895 -----
  #ifdef LOOK
  		if (wild)
  			/* string has wild card characters */
! 			sprintf (cmd, "%s '^%s$' %s", EGREPCMD, grepstr, WORDS);
  		else
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);
***************
*** 890,896
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);
  #else
! 		sprintf (cmd, "%s -i '^%s$' %s", EGREPCMD, grepstr, WORDS);
  #endif
  		shellescape (cmd);
  	}

--- 894,900 -----
  			/* no wild, use look(1) */
  			sprintf (cmd, "/usr/bin/look -df %s %s", grepstr, WORDS);
  #else
! 		sprintf (cmd, "%s '^%s$' %s", EGREPCMD, grepstr, WORDS);
  #endif
  		shellescape (cmd);
  	}
-- 

	Geoff Kuenning
	{hplabs,ihnp4}!trwrb!desint!geoff
Technical Details
Message-ID: <292@desint.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!hplabs!sdcrdcf!trwrb!desint!geoff

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!hplabs!sdcrdcf!trwrb!desint!geoff
From: geoff@desint.UUCP
Newsgroups: net.sources.bugs
Subject: ispell incorrectly handles plurals (or is that plurales?)
Message-ID: <292@desint.UUCP>
Date: Sat, 28-Feb-87 04:16:30 EST
Article-I.D.: desint.292
Posted: Sat Feb 28 04:16:30 1987
Date-Received: Sun, 1-Mar-87 17:18:01 EST
Reply-To: geoff@desint.UUCP (Geoff Kuenning)
Distribution: world
Organization: Interrupt Technology Corp., Manhattan Beach, CA
Lines: 107