private void ismEndings() { if (endsIn('i', 's', 'm')) { /* * this is a very productive ending, so just * accept it */ word.setLength(j + 1); k = j; lookup(); } return; }
private void mentEndings() { int old_k = k; if (endsIn('m', 'e', 'n', 't')) { word.setLength(j + 1); k = j; if (lookup()) return; word.append("ment"); k = old_k; // nolookup } return; }
private void nessEndings() { if (endsIn('n', 'e', 's', 's')) { /* * this is a very productive endings, so * just accept it */ word.setLength(j + 1); k = j; if (word.charAt(j) == 'i') word.setCharAt(j, 'y'); lookup(); } return; }
private void ncyEndings() { if (endsIn('n', 'c', 'y')) { if (!((word.charAt(j) == 'e') || (word.charAt(j) == 'a'))) return; word.setCharAt(j + 2, 't'); /* try converting -ncy to -nt */ word.setLength(j + 3); k = j + 2; if (lookup()) return; word.setCharAt(j + 2, 'c'); /* the default is to convert it to -nce */ word.unsafeWrite('e'); k = j + 3; lookup(); } return; }
private void nceEndings() { int old_k = k; char word_char; if (endsIn('n', 'c', 'e')) { word_char = word.charAt(j); if (!((word_char == 'e') || (word_char == 'a'))) return; word.setLength(j); word.unsafeWrite('e'); /* try converting -e/ance to -e (adherance/adhere) */ k = j; if (lookup()) return; word.setLength(j); /* * try removing -e/ance altogether * (disappearance/disappear) */ k = j - 1; if (lookup()) return; word.unsafeWrite(word_char); /* restore the original ending */ word.append("nce"); k = old_k; // nolookup() because we restored the original ending } return; }
private void ionEndings() { int old_k = k; if (!endsIn('i', 'o', 'n')) { return; if (endsIn(ization)) { /* if (endsIn(ition)) { word.setLength(j + 1); word.unsafeWrite('e'); k = old_k; } else if (endsIn(ation)) { word.setLength(j + 3); word.unsafeWrite('e'); if (endsIn(ication)) { word.setLength(j + 1); word.unsafeWrite('y');
private void icEndings() { if (endsIn('i', 'c')) { word.setLength(j + 3); word.append("al"); /* try converting -ic to -ical */ k = j + 4; if (lookup()) return; word.setCharAt(j + 1, 'y'); /* try converting -ic to -y */ word.setLength(j + 2); k = j + 1; if (lookup()) return; word.setCharAt(j + 1, 'e'); /* try converting -ic to -e */ if (lookup()) return; word.setLength(j + 1); /* try removing -ic altogether */ k = j; if (lookup()) return; word.append("ic"); /* restore the original ending */ k = j + 2; // nolookup() } return; }
private void izeEndings() { int old_k = k; if (endsIn('i', 'z', 'e')) { word.setLength(j + 1); /* try removing -ize entirely */ k = j; if (lookup()) return; word.unsafeWrite('i'); if (doubleC(j)) { /* allow for a doubled consonant */ word.setLength(j); k = j - 1; if (lookup()) return; word.unsafeWrite(word.charAt(j - 1)); } word.setLength(j + 1); word.unsafeWrite('e'); /* try removing -ize and adding -e */ k = j + 1; if (lookup()) return; word.setLength(j + 1); word.append("ize"); k = old_k; // nolookup() } return; }
char word_char; if (endsIn('b', 'l', 'e')) { if (!((word.charAt(j) == 'a') || (word.charAt(j) == 'i'))) return; word_char = word.charAt(j);
private void iveEndings() { int old_k = k; if (endsIn('i', 'v', 'e')) { word.setLength(j + 1); /* try removing -ive entirely */ k = j;
private void ismEndings() { if (endsIn('i', 's', 'm')) { /* * this is a very productive ending, so just * accept it */ word.setLength(j + 1); k = j; lookup(); } return; }
private void lyEndings() { int old_k = k; if (endsIn('l', 'y')) {
if (endsIn('i', 'n', 'g') && vowelInStem()) {
private void ityEndings() { int old_k = k; if (endsIn('i', 't', 'y')) { word.setLength(j + 1); /* try just removing -ity */ k = j;
private void mentEndings() { int old_k = k; if (endsIn('m', 'e', 'n', 't')) { word.setLength(j + 1); k = j; if (lookup()) return; word.append("ment"); k = old_k; // nolookup } return; }
private void nessEndings() { if (endsIn('n', 'e', 's', 's')) { /* * this is a very productive endings, so * just accept it */ word.setLength(j + 1); k = j; if (word.charAt(j) == 'i') word.setCharAt(j, 'y'); lookup(); } return; }
if (endsIn('a', 'l')) { word.setLength(j + 1); k = j;