public int stem(final char s[], int len) {if (len < 4) return len;if (len > 5 && endsWith(s, len, "ища"))return len - 3;len = removeArticle(s, len);len = removePlural(s, len);if (len > 3) {if (endsWith(s, len, "я"))len--;if (endsWith(s, len, "а") ||endsWith(s, len, "о") ||endsWith(s, len, "е"))len--;}if (len > 4 && endsWith(s, len, "ен")) {s[len - 2] = 'н'; len--;}if (len > 5 && s[len - 2] == 'ъ') {s[len - 2] = s[len - 1]; len--;}return len;}

public virtual int Stem(char[] s, int len){if (len < 4) {return len;}if (len > 5 && StemmerUtil.EndsWith(s, len, "ища")){return len - 3;}len = RemoveArticle(s, len);len = RemovePlural(s, len);if (len > 3){if (StemmerUtil.EndsWith(s, len, "я")){len--;}if (StemmerUtil.EndsWith(s, len, "а") || StemmerUtil.EndsWith(s, len, "о") || StemmerUtil.EndsWith(s, len, "е")){len--;}}if (len > 4 && StemmerUtil.EndsWith(s, len, "ен")){s[len - 2] = 'н'; len--;}if (len > 5 && s[len - 2] == 'ъ'){s[len - 2] = s[len - 1]; len--;}return len;}
