function step5 in Porter-Stemmer 5
Same name and namespace in other branches
- 6 porterstemmer.module \step5()
Step 5
Parameters
string $word Word to stem:
1 call to step5()
- stem in ./
porterstemmer.module - Stems a word. Simple huh?
File
- ./
porterstemmer.module, line 310
Code
function step5($word) {
// Part a
if (substr($word, -1) == 'e') {
if (m(substr($word, 0, -1)) > 1) {
replace($word, 'e', '');
}
else {
if (m(substr($word, 0, -1)) == 1) {
if (!cvc(substr($word, 0, -1))) {
replace($word, 'e', '');
}
}
}
}
// Part b
if (m($word) > 1 and doubleConsonant($word) and substr($word, -1) == 'l') {
$word = substr($word, 0, -1);
}
return $word;
}