private void plural() {
    if (word.charAt(k) == 's') {
      if (endsIn('i', 'e', 's')) {
        word.setLength(j + 3);
        k--;
        if (lookup()) /* ensure calories -> calorie */
        return;
        k++;
        word.unsafeWrite('s');
        setSuffix("y");
        lookup();
      } else if (endsIn('e', 's')) {
        /* try just removing the "s" */
        word.setLength(j + 2);
        k--;
        
        /*
         * note: don't check for exceptions here. So, `aides' -> `aide', but
         * `aided' -> `aid'. The exception for double s is used to prevent
         * crosses -> crosse. This is actually correct if crosses is a plural
         * noun (a type of racket used in lacrosse), but the verb is much more
         * common
         */

        /****
         * YCS: this was the one place where lookup was not followed by return.
         * So restructure it. if ((j>0)&&(lookup(word.toString())) &&
         * !((word.charAt(j) == 's') && (word.charAt(j-1) == 's'))) return;
         *****/
        boolean tryE = j > 0
            && !((word.charAt(j) == 's') && (word.charAt(j - 1) == 's'));
        if (tryE && lookup()) return;
        
        /* try removing the "es" */

        word.setLength(j + 1);
        k--;
        if (lookup()) return;
        
        /* the default is to retain the "e" */
        word.unsafeWrite('e');
        k++;
        
        if (!tryE) lookup(); // if we didn't try the "e" ending before
        return;
      } else {
        if (word.length() > 3 && penultChar() != 's' && !endsIn('o', 'u', 's')) {
          /* unless the word ends in "ous" or a double "s", remove the final "s" */

          word.setLength(k);
          k--;
          lookup();
        }
      }
    }
  }
if (matchedEntry != null) { if (dict_ht.get(word.getArray(), 0,
word.size()) != matchedEntry) {
System.out.println("Uh oh... cached entry doesn't match"); } return
matchedEntry; }
*
linguistics/src/main/java/com/yahoo/language/simple/kstem/KStemmer.java