function porterstemmer_exception2 in Porter-Stemmer 7
Same name and namespace in other branches
- 6.2 porterstemmer.module \porterstemmer_exception2()
Checks exceptions for Porter Stemmer after Step 1a.
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_exception2()
- porterstemmer_stem in includes/
standard-stemmer.inc - Stems a word, using the Porter Stemmer 2 algorithm.
File
- includes/
standard-stemmer.inc, line 615 - This is an implementation of the Porter 2 Stemming algorithm.
Code
function porterstemmer_exception2(&$word) {
// The following words are to be left invariant.
$repl = array(
'inning' => 1,
'outing' => 1,
'canning' => 1,
'herring' => 1,
'earring' => 1,
'proceed' => 1,
'exceed' => 1,
'succeed' => 1,
);
if (isset($repl[$word])) {
return TRUE;
}
return FALSE;
}