| 137 | | { FUZZY_STEMMING_HU, "Stemming_hu", Stem_snowball, hungarian_ISO_8859_1_create_env, hungarian_ISO_8859_1_close_env, hungarian_ISO_8859_1_stem }, |
|---|
| 138 | | /* these next two are deprecated and are identical to Stemming_en1 */ |
|---|
| 139 | | { FUZZY_STEMMING_EN1, "Stemming_en", Stem_snowball, porter_ISO_8859_1_create_env, porter_ISO_8859_1_close_env, porter_ISO_8859_1_stem }, |
|---|
| 140 | | { FUZZY_STEMMING_EN1, "Stem", Stem_snowball, porter_ISO_8859_1_create_env, porter_ISO_8859_1_close_env, porter_ISO_8859_1_stem } |
|---|
| | 137 | { FUZZY_STEMMING_HU, "Stemming_hu", Stem_snowball, hungarian_ISO_8859_1_create_env, hungarian_ISO_8859_1_close_env, hungarian_ISO_8859_1_stem } |
|---|
| 414 | | |
|---|
| 415 | | /************************************************************************* |
|---|
| 416 | | * SwishStemWord -- utility function to stem a word |
|---|
| 417 | | * |
|---|
| 418 | | * This stores the stemmed word locally so it can be freed |
|---|
| 419 | | # *Depreciated* because this only calls the original stemmer. |
|---|
| 420 | | * |
|---|
| 421 | | **************************************************************************/ |
|---|
| 422 | | |
|---|
| 423 | | char *SwishStemWord( SWISH *sw, char *word ) |
|---|
| 424 | | { |
|---|
| 425 | | FUZZY_OBJECT *fo = NULL; |
|---|
| 426 | | FUZZY_WORD *fw = NULL; |
|---|
| 427 | | |
|---|
| 428 | | if ( sw->stemmed_word ) |
|---|
| 429 | | { |
|---|
| 430 | | efree( sw->stemmed_word ); |
|---|
| 431 | | sw->stemmed_word = NULL; |
|---|
| 432 | | } |
|---|
| 433 | | |
|---|
| 434 | | fo = set_fuzzy_mode( fo, "Stem" ); |
|---|
| 435 | | if ( !fo ) |
|---|
| 436 | | return sw->stemmed_word; |
|---|
| 437 | | |
|---|
| 438 | | fw = fuzzy_convert( fo, word ); |
|---|
| 439 | | sw->stemmed_word = estrdup( fw->string_list[0] ); |
|---|
| 440 | | fuzzy_free_word( fw ); |
|---|
| 441 | | |
|---|
| 442 | | free_fuzzy_mode( fo ); |
|---|
| 443 | | return sw->stemmed_word; |
|---|
| 444 | | |
|---|
| 445 | | } |
|---|
| 446 | | |
|---|