You are here

function porterstemmer_step_ending in Porter-Stemmer 6.2

Same name and namespace in other branches
  1. 7 includes/standard-stemmer.inc \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 ./porterstemmer.module
Step 0 of the algorithm: remove possessive endings.
porterstemmer_step1a in ./porterstemmer.module
Step 1a of algorithm: plurals, etc.
porterstemmer_step1b in ./porterstemmer.module
Step 1b of algorithm: eed, eedly, ed, edly, ing, ingly
porterstemmer_step1c in ./porterstemmer.module
Step 1c of algorithm: y suffixes
porterstemmer_step2 in ./porterstemmer.module
Step 2 of algorithm: misc endings in region R1.

... See full list

File

./porterstemmer.module, line 229
This is an implementation of the Porter 2 Stemming algorithm from http://snowball.tartarus.org/algorithms/english/stemmer.html by Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com

Code

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