Changeset 2136
- Timestamp:
- 04/22/08 09:45:56 (4 weeks ago)
- Files:
-
- swish-e/branches/2.6/perl/API.pm (modified) (1 diff)
- swish-e/branches/2.6/perl/API.xs (modified) (1 diff)
- swish-e/branches/2.6/src/stemmer.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
swish-e/branches/2.6/perl/API.pm
r2025 r2136 550 550 there's no need to specify the index file name. 551 551 552 553 554 =item $stemmed_word = $swish-E<gt>stem_word( $word );555 556 *Deprecated*557 558 Returns the stemmed version of the passed in word.559 560 Deprecated because only stems using the original Porter Stemmer561 and uses a shared memory location in the SW_HANDLE object to store the stemmed562 word. See below for other stemming options.563 564 565 552 =item $fuzzy_word = $swish-E<gt>Fuzzify( $indexname, $word ); 566 553 swish-e/branches/2.6/perl/API.xs
r1774 r2136 425 425 } 426 426 427 428 429 char *430 SwishStemWord(handle, word)431 SW_HANDLE handle432 char *word433 434 435 436 437 427 # ************************************************************** 438 428 # swish-e/branches/2.6/src/stemmer.c
r1950 r2136 135 135 { FUZZY_STEMMING_FI, "Stemming_fi", Stem_snowball, finnish_ISO_8859_1_create_env, finnish_ISO_8859_1_close_env, finnish_ISO_8859_1_stem }, 136 136 { FUZZY_STEMMING_RO, "Stemming_ro", Stem_snowball, romanian_ISO_8859_2_create_env, romanian_ISO_8859_2_close_env, romanian_ISO_8859_2_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 }, 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 } 141 138 142 139 … … 278 275 if ( 0 == strcasecmp(fuzzy_opts[i].name, param ) ) 279 276 { 280 if ( fuzzy_opts[i].name == "Stem" || fuzzy_opts[i].name == "Stemming_en" )281 {282 fprintf(stderr, "*************\n");283 fprintf(stderr, " Old stemmer '%s' is no longer supported -- using Stemming_en1 instead.\n", fuzzy_opts[i].name);284 fprintf(stderr, " Please update your config file.\n*************\n");285 }286 287 277 return create_fuzzy_struct( fi, &fuzzy_opts[i] ); 288 278 } … … 412 402 413 403 414 415 /*************************************************************************416 * SwishStemWord -- utility function to stem a word417 *418 * This stores the stemmed word locally so it can be freed419 # *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 447 404 /************************************************************************ 448 405 * SwishFuzzyWord -- utility function to stem a word based on the current result
