You are here

function stem in Porter-Stemmer 6

Same name and namespace in other branches
  1. 5 porterstemmer.module \stem()

Stems a word. Simple huh?

Parameters

string $word Word to stem:

Return value

string Stemmed word

File

./porterstemmer.module, line 58

Code

function stem($word) {
  if (strlen($word) <= 2) {
    return $word;
  }
  $word = step1ab($word);
  $word = step1c($word);
  $word = step2($word);
  $word = step3($word);
  $word = step4($word);
  $word = step5($word);
  return $word;
}