You are here

function porterstemmer_step_ending in Porter-Stemmer 7

Same name and namespace in other branches
  1. 6.2 porterstemmer.module \porterstemmer_step_ending()

Replaces word and calculates return value for steps.

If $tmp is long enough, replaces $word with $tmp and returns FALSE to continue stemming process. If $tmp is too short, no replacement and returns TRUE to end stemming process.

8 calls to porterstemmer_step_ending()
porterstemmer_step0 in includes/standard-stemmer.inc
Step 0 of the algorithm: remove possessive endings.
porterstemmer_step1a in includes/standard-stemmer.inc
Step 1a of algorithm: plurals, etc.
porterstemmer_step1b in includes/standard-stemmer.inc
Step 1b of algorithm: eed, eedly, ed, edly, ing, ingly.
porterstemmer_step1c in includes/standard-stemmer.inc
Step 1c of algorithm: y suffixes.
porterstemmer_step2 in includes/standard-stemmer.inc
Step 2 of algorithm: misc endings in region R1.

... See full list

File

includes/standard-stemmer.inc, line 97
This is an implementation of the Porter 2 Stemming algorithm.

Code

function porterstemmer_step_ending(&$word, $tmp) {
  if (porterstemmer_too_short($tmp)) {
    return TRUE;
  }
  $word = $tmp;
  return FALSE;
}