public virtual String Stem(String input)
{
markPositions(input);
if (RV == 0)
return input; //RV wasn't detected, nothing to stem
StringBuilder stemmingZone = new StringBuilder(input.Substring(RV));
// stemming goes on in RV
// Step 1
if (!perfectiveGerund(stemmingZone))
{
reflexive(stemmingZone);
// variable r is unused, we are just interested in the flow that gets
// created by logical expression: apply adjectival(); if that fails,
// apply verb() etc
bool r =
adjectival(stemmingZone)
|| Verb(stemmingZone)
|| noun(stemmingZone);
}
// Step 2
removeI(stemmingZone);
// Step 3
derivational(stemmingZone);
// Step 4
Superlative(stemmingZone);
UndoubleN(stemmingZone);
removeSoft(stemmingZone);
// return result
return input.Substring(0, RV) + stemmingZone.ToString();
}