You are here

function step3 in Porter-Stemmer 5

Same name and namespace in other branches
  1. 6 porterstemmer.module \step3()

Step 3

Parameters

string $word String to stem:

1 call to step3()
stem in ./porterstemmer.module
Stems a word. Simple huh?

File

./porterstemmer.module, line 201

Code

function step3($word) {
  switch (substr($word, -2, 1)) {
    case 'a':
      replace($word, 'ical', 'ic', 0);
      break;
    case 's':
      replace($word, 'ness', '', 0);
      break;
    case 't':
      replace($word, 'icate', 'ic', 0) or replace($word, 'iciti', 'ic', 0);
      break;
    case 'u':
      replace($word, 'ful', '', 0);
      break;
    case 'v':
      replace($word, 'ative', '', 0);
      break;
    case 'z':
      replace($word, 'alize', 'al', 0);
      break;
  }
  return $word;
}