NlpTools API
Class

NlpTools\Stemmers\LancasterStemmer

class LancasterStemmer extends Stemmer

A word stemmer based on the Lancaster stemming algorithm.

Paice, Chris D. "Another Stemmer." ACM SIGIR Forum 24.3 (1990): 56-61.

Constants

ENDING_STRING

Constants used to make accessing the indexed array easier

LOOKUP_CHAR

INTACT_FLAG

REMOVE_TOTAL

APPEND_STRING

CONTINUE_FLAG

Methods

string stem(string $word)

Performs a Lancaster stem on the giving word

array stemAll(array $tokens)

Apply the stemmer to every single token.

from Stemmer
mixed transform($word)

Return the value transformed.

from Stemmer
__construct(array $ruleSet = array())

Constructor loads the ruleset into memory

static array getDefaultRuleSet()

Contains an array with the default lancaster rules

Details

at line 79
public string stem(string $word)

Performs a Lancaster stem on the giving word

Parameters

string $word The word that gets stemmed

Return Value

string The stemmed word

in Stemmer at line 25
public array stemAll(array $tokens)

Apply the stemmer to every single token.

Parameters

array $tokens

Return Value

array

in Stemmer at line 34
public mixed transform($word)

Return the value transformed.

Parameters

$word

Return Value

mixed

at line 45
public __construct(array $ruleSet = array())

Constructor loads the ruleset into memory

Parameters

array $ruleSet the set of rules that will be used by the lancaster algorithm. if empty this will use the default ruleset embedded in the LancasterStemmer

at line 159
static public array getDefaultRuleSet()

Contains an array with the default lancaster rules

Return Value

array