Skip to main content.
home | support | download

Back to List Archive

Re: RE: Failing to find a word

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Oct 08 1999 - 17:34:19 GMT
Here's my patch.  It's been a long time since I wrote any C. Could someone
please check my work?  It took me a while just to remember how to do a
strcpy()!

I moved Stem() into expandstar():

The files in .. are the old files.


D:\swish\src>diff search.c ../search.c
48d47
<
393,403d391
<
<             /* Stem wild card term before expanding */
<               if (applyStemmingRules)
<               {
<                       /* apply stemming algorithm to the search term */
<                       Stem(searchword);
<               }
<
<
<
<
405,406d392
<
<
434,441d419
<
<             /* Stem non-star words */
<               if (applyStemmingRules)
<               {
<                       /* apply stemming algorithm to the search term */
<                       Stem(searchword);
<               }
<
777a756,761
>
>       if (applyStemmingRules)
>       {
>               /* apply stemming algorithm to the search term */
>               Stem(word);
>       }

D:\swish\src>diff stemmer.c ../stemmer.c
494,501d493
<
<
<    /*  Hack to make sure Stem() doesn't stem the word into nonexistence */
<    char saveword[MAXWORDLEN];
<    strcpy( saveword, word );
<
<
<
525,529d516
<
<
<    /* Restore to original if stems to nothing */
<    if ( !strcmp( word, "" ) ) strcpy( word, saveword );
<



Bill Moseley
mailto:moseley@hank.org
Received on Fri Oct 8 10:38:20 1999