Skip to main content.
home | support | download

Back to List Archive

stemmer.c and swish-2.1.x

From: <jmruiz(at)not-real.boe.es>
Date: Mon Oct 30 2000 - 18:46:48 GMT
Hi Bill,

I forgot to mention one thing in my last post about 2.1.x.

Finally, I have updated stemmer.c. Now it is thread safe
and it also is independent of the string length or any other
buffer length assumption.

I have made a small modification of the function. Now the call
changes how the paramater is passed. Now it looks like:

int Stem( word, lenword ) /* redefined - Moseley 10/17/99 */
   char **word;  /* in/out: the word stemmed */
   int *lenword;  /* in/out: the length of word stemmed */

So if more memory is neded, word buffer would be reallocated.

Eg:

char *myword;
int mywordlen;

myword=emalloc(6);
strcpy(myword,"hello");
Stem(&myword,&mywordlen);

So, if the stemmed word needs 7 bytes, the Stem function will 
reallocate the buffer.

cu
Jose
Received on Mon Oct 30 18:49:30 2000