private boolean endsIn(char[] s) {
    if (s.length > k) return false;
    
    int r = word.length() - s.length; /* length of word before this suffix */
    j = k;
    for (int r1 = r, i = 0; i < s.length; i++, r1++) {
      if (s[i] != word.charAt(r1)) return false;
    }
    j = r - 1; /* index of the character BEFORE the posfix */
    return true;
  }
A stemmer implementing the Kstem algorithm by Bob Krovetz.
linguistics/src/main/java/com/yahoo/language/simple/kstem/KStemmer.java