[Snowball-discuss] Patches for stem_english.c

Olly Betts olly at survex.com
Tue Jul 20 13:46:10 BST 2010


Hi Snowballers,

I've attached 4 patches for stem_english.c - these are:

snowball-01-singly.patch

Bug-fix - currently "singly" stems to "singl\0" (I suspect most callers use
the length to nul-terminate, so the extra nul goes unnoticed.

snowball-02-missing-return.patch

There's a missing return on one case in a switch.  This means we'll fall
through into the next case, but that will never match so this bug just
causes a small performance penalty for words which go through the case
with the missing return.

snowball-03-use-isalpha.patch

In the C locale (which the test code runs in since it doesn't call
setlocale()), isupper(ch) || islower(ch) is equivalent to isalpha(ch).

snowball-04-ctype.patch

The algorithm part of the code uses tolower() but doesn't include
<ctype.h> to get it declared.

Cheers,
    Olly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snowball-01-singly.patch
Type: text/x-diff
Size: 701 bytes
Desc: not available
URL: <http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20100721/0c477b88/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snowball-02-missing-return.patch
Type: text/x-diff
Size: 486 bytes
Desc: not available
URL: <http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20100721/0c477b88/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snowball-03-use-isalpha.patch
Type: text/x-diff
Size: 737 bytes
Desc: not available
URL: <http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20100721/0c477b88/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snowball-04-ctype.patch
Type: text/x-diff
Size: 367 bytes
Desc: not available
URL: <http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20100721/0c477b88/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.tartarus.org/mailman/private/snowball-discuss/attachments/20100721/0c477b88/attachment.pgp>


More information about the Snowball-discuss mailing list