public String stem(String word){
  if (word.length() > 2) {
    return recodeEnding(removeEnding(word.toLowerCase()));
  }
 else {
    return word.toLowerCase();
  }
}

public String stem ( String word ) { if ( word . length ( ) > 2 ) { return recodeEnding ( removeEnding ( word . toLowerCase ( ) ) ) ; } else { return word . toLowerCase ( ) ; } }
returns the stemmed version of the given word . word is converted to lower case before stemming .
