🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: net.sources.bugs
3 messages
3 total messages Started by geoff Sat, 28 Feb 1987 09:16
ispell incorrectly handles plurals (or is that plurales?)
#952
Author: 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
Re: ispell incorrectly handles plurals (or is that plurales?)
#961
Author: Bill Randle
Date: Mon, 09 Mar 1987 23:02
57 lines
2287 bytes
Thanks to Geoff for finding the correct qualification to use in the test
in s_ending() in good.c.  This will properly report bad -es endings,
but unfortunately will not suggest a correct alternative.  Also,
some words that are correctly spelled are still reported as bad.
This is a test file that I ran thru ispell:
	***************
This is a ispell test for plurals.  Many activitys have misspelled
words.  It should also catch activityes and hawkes and do something.
This one is correct: activities.
	***************
Ispell as modified with Geoff's changes and without the additional
changes I submitted at the same time shows:

activitys -->
  0. activity

activityes -->

hawkes  -->
  0. ---
  1. ---
  2. hawks
  3. ---

activities -->

Note that the alternative lookup  finds "hawks" because it is a single
letter change (drop the 'e') away from "hawkes".  Although "activities"
is a single letter change (switch 'y' to 'i') from "activityes", the
"-ies" plural ending is not recognized as a good word.

If you merge the changes I suggested with the proper qualification as
suggested by Geoff [the other changes were a few more lines in
s_ending() and a new routine wrongplural() in ispell.c], ispell shows:

activitys -->
  0. activity
  1. activities

activityes -->
  0. activities

hawkes  -->
  0. ---
  1. ---
  2. hawks
  3. ---

[activities does not show as bad]

Now I will be the first to agree that this may be kludegy (sp?) but
it is helpful for people who have problems with -yxx and -ixx endings.
-- 

	-Bill Randle
	Tektronix, Inc.
	billr@tekred.TEK.COM
Re: ispell incorrectly handles plurals (or is that plurales?)
#971
Author: u3369429
Date: Sun, 15 Mar 1987 08:26
1 lines
693 bytes
FYI: It's pluralia
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads