4
* Variant of the Lovin's stemmer which uses a longest match algorithm.
5
* Endings are stored in a suffix tree.
16
/* is exists left tree ? */
18
/* finish word flag */
20
#define ISLEFT(x) (((ru_RUKOI8R_NODE*)x)->flag & L)
21
#define ISFINISH(x) (((ru_RUKOI8R_NODE*)x)->flag & F)
25
static ru_RUKOI8R_NODE ru_RUKOI8R_endstree[]={
17919
static ru_RUKOI8R_NODE ru_RUKOI8R_stoptree[]={
18239
ru_RUKOI8R_stem( void* obj, char *in, int *len ) {
18240
ru_RUKOI8R_NODE *ptr = ru_RUKOI8R_endstree;
18242
uint8 *buf = (uint8 *)in;
18243
uint8 *cur = buf + (*len) - 1;
18245
while( cur - buf >= MINLENREST ) {
18246
*cur = tolower((unsigned char) *cur );
18247
if ( ptr->val == *cur ) {
18248
if ( ISFINISH(ptr) ) result = buf + (*len) - cur;
18250
if ( ! ptr->child ) break;
18252
} else if ( ptr->val > *cur ) {
18264
while( cur - buf >= 0 ) {
18265
*cur = tolower((unsigned char) *cur);
18274
ru_RUKOI8R_is_stopword( void *obj, char *in, int len ) {
18275
ru_RUKOI8R_NODE *ptr = ru_RUKOI8R_stoptree;
18277
uint8 *buf = (uint8 *)in;
18280
while( cur - buf < len ) {
18281
*cur = tolower((unsigned char) *cur );
18282
if ( ptr->val == *cur ) {
18284
if ( ISFINISH(ptr) ) result = cur - buf;
18285
if ( ! ptr->child ) break;
18287
} else if ( ptr->val > *cur ) {
18299
return (result==len) ? 1 : 0;
18307
#endif /* DICT_BODY */
18315
ru_RUKOI8R_is_stopword,