Class flTextStemmer
flTextStemmer Class
Base class for all language specific stemmers.
Package: fusionLib
Copyright:
Copyright (c) 2006 - 2013 fusionLib. All rights reserved.
Located at system/libs/Text/flTextStemmer.php
Methods summary
public static
flTextStemmer
|
#
load( string $lang )
Load the stemmer based on the language code.
Load the stemmer based on the language code.
If no stemmer is available then an instance of flSearchStemmer is returned.
Parameters
- $lang
- The language to load the stemmer for, e.g. en, see ISO 639 for the list of 2 letter codes.
Returns
|
public
string
|
#
stem( string $word )
Calculate and return the stemmed version of a word.
Calculate and return the stemmed version of a word.
Note: The default implementation returns the original word unchanged.
Parameters
- $word
- The lowercase word to stem.
Returns
string The stemmed word.
|
public
array
|
#
stemWords( array $words )
For each word in an array calculate it's stemmed equivalent.
For each word in an array calculate it's stemmed equivalent.
Duplicates are not removed from the array, there is exactly the same number of
words in the results as the source.
Parameters
- $words
- Array of words to stem
Returns
array Array holding the stemmed words
|