You are here

function porterstemmer_step0 in Porter-Stemmer 7

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

Step 0 of the algorithm: remove possessive endings.

Parameters

string $word: Word to stem, modified in place if successful.

Return value

bool TRUE if it is time to stop stemming, FALSE to continue.

1 call to porterstemmer_step0()
porterstemmer_stem in includes/standard-stemmer.inc
Stems a word, using the Porter Stemmer 2 algorithm.

File

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

Code

function porterstemmer_step0(&$word) {
  $tmp = $word;
  $didit = FALSE;
  porterstemmer_suffix($tmp, "'s'", '', $didit) or porterstemmer_suffix($tmp, "'s", '', $didit) or porterstemmer_suffix($tmp, "'", '', $didit);
  return porterstemmer_step_ending($word, $tmp);
}