diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/AbstractSnowballStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/AbstractSnowballStemmer.java
index 33ef30373..b28ad9354 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/AbstractSnowballStemmer.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/AbstractSnowballStemmer.java
@@ -32,6 +32,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
package opennlp.tools.stemmer.snowball;
+/**
+ * Parent class of all snowball stemmers, which must implement stem
+ */
abstract class AbstractSnowballStemmer extends SnowballProgram {
public abstract boolean stem();
+
+ static final long serialVersionUID = 2016072500L;
}
diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/Among.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/Among.java
index 75fdc8ef3..c91d9aa6f 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/Among.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/Among.java
@@ -30,17 +30,18 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
*/
-// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9)
+// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57)
package opennlp.tools.stemmer.snowball;
-import java.lang.reflect.Method;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.util.Locale;
+/**
+ * Internal class used by Snowball stemmers
+ */
public class Among {
- public final char[] s; /* search string */
- public final int substring_i; /* index to longest matching substring */
- public final int result; /* result of the lookup */
- public final Method method; /* method to use if substring matches */
-
public Among(String s, int substring_i, int result) {
this.s = s.toCharArray();
this.substring_i = substring_i;
@@ -49,14 +50,30 @@ public Among(String s, int substring_i, int result) {
}
public Among(String s, int substring_i, int result, String methodname,
- Class extends AbstractSnowballStemmer> programclass) {
+ MethodHandles.Lookup methodobject) {
this.s = s.toCharArray();
this.substring_i = substring_i;
this.result = result;
- try {
- this.method = programclass.getDeclaredMethod(methodname);
- } catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
+ final Class extends SnowballProgram> clazz = methodobject.lookupClass().asSubclass(SnowballProgram.class);
+ if (methodname.length() > 0) {
+ try {
+ this.method = methodobject.findVirtual(clazz, methodname, MethodType.methodType(boolean.class))
+ .asType(MethodType.methodType(boolean.class, SnowballProgram.class));
+ } catch (NoSuchMethodException | IllegalAccessException e) {
+ throw new RuntimeException(String.format(Locale.ENGLISH,
+ "Snowball program '%s' is broken, cannot access method: boolean %s()",
+ clazz.getSimpleName(), methodname
+ ), e);
+ }
+ } else {
+ this.method = null;
}
}
-}
+
+ final char[] s; /* search string */
+ final int substring_i; /* index to longest matching substring */
+ final int result; /* result of the lookup */
+
+ // Make sure this is not accessible outside package for Java security reasons!
+ final MethodHandle method; /* method to use if substring matches */
+};
\ No newline at end of file
diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/SnowballProgram.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/SnowballProgram.java
index d3c26740f..451116b05 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/SnowballProgram.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/SnowballProgram.java
@@ -32,68 +32,103 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
package opennlp.tools.stemmer.snowball;
-import java.lang.reflect.InvocationTargetException;
+import java.io.Serializable;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+/**
+ * Base class for a snowball stemmer
+ */
+public class SnowballProgram implements Serializable {
-class SnowballProgram {
+ protected SnowballProgram() {
+ setCurrent("");
+ }
- private static final Logger logger = LoggerFactory.getLogger(SnowballProgram.class);
- // current string
- protected StringBuilder current;
- protected int cursor;
- protected int limit;
- protected int limit_backward;
- protected int bra;
- protected int ket;
+ static final long serialVersionUID = 2016072500L;
- protected SnowballProgram() {
- current = new StringBuilder();
- init();
+ /**
+ * Set the current string.
+ */
+ public void setCurrent(String value) {
+ setCurrent(value.toCharArray(), value.length());
}
- public SnowballProgram(SnowballProgram other) {
- current = other.current;
- cursor = other.cursor;
- limit = other.limit;
- limit_backward = other.limit_backward;
- bra = other.bra;
- ket = other.ket;
+ /**
+ * Get the current string.
+ */
+ public String getCurrent() {
+ return new String(current, 0, length);
}
- private void init() {
+ /**
+ * Set the current string.
+ *
+ * @param text character array containing input
+ * @param length valid length of text.
+ */
+ public void setCurrent(char[] text, int length) {
+ current = text;
cursor = 0;
- limit = current.length();
+ this.length = limit = length;
limit_backward = 0;
bra = cursor;
ket = limit;
}
/**
- * Get the current string.
+ * Get the current buffer containing the stem.
+ *
+ * NOTE: this may be a reference to a different character array than the + * one originally provided with setCurrent, in the exceptional case that + * stemming produced a longer intermediate or result string. + *
+ *+ * It is necessary to use {@link #getCurrentBufferLength()} to determine + * the valid length of the returned buffer. For example, many words are + * stemmed simply by subtracting from the length to remove suffixes. + *
+ * + * @see #getCurrentBufferLength() */ - public String getCurrent() { - return current.toString(); + public char[] getCurrentBuffer() { + return current; } /** - * Set the current string. + * Get the valid length of the character array in + * {@link #getCurrentBuffer()}. + * + * @return valid length of the array. */ - public void setCurrent(String value) { - // Make a new StringBuilder. If we reuse the old one, and a user of - // the library keeps a reference to the buffer returned (for example, - // by converting it to a String in a way which doesn't force a copy), - // the buffer size will not decrease, and we will risk wasting a large - // amount of memory. - // Thanks to Wolfram Esser for spotting this problem. - current = new StringBuilder(value); - init(); + public int getCurrentBufferLength() { + return length; + } + + // current string + private char[] current; + + protected int cursor; + protected int length; + protected int limit; + protected int limit_backward; + protected int bra; + protected int ket; + + public SnowballProgram(SnowballProgram other) { + current = other.current; + cursor = other.cursor; + length = other.length; + limit = other.limit; + limit_backward = other.limit_backward; + bra = other.bra; + ket = other.ket; } protected void copy_from(SnowballProgram other) { current = other.current; cursor = other.cursor; + length = other.length; limit = other.limit; limit_backward = other.limit_backward; bra = other.bra; @@ -104,7 +139,7 @@ protected boolean in_grouping(char[] s, int min, int max) { if (cursor >= limit) { return false; } - char ch = current.charAt(cursor); + char ch = current[cursor]; if (ch > max || ch < min) { return false; } @@ -120,7 +155,7 @@ protected boolean in_grouping_b(char[] s, int min, int max) { if (cursor <= limit_backward) { return false; } - char ch = current.charAt(cursor - 1); + char ch = current[cursor - 1]; if (ch > max || ch < min) { return false; } @@ -136,7 +171,7 @@ protected boolean out_grouping(char[] s, int min, int max) { if (cursor >= limit) { return false; } - char ch = current.charAt(cursor); + char ch = current[cursor]; if (ch > max || ch < min) { cursor++; return true; @@ -153,7 +188,7 @@ protected boolean out_grouping_b(char[] s, int min, int max) { if (cursor <= limit_backward) { return false; } - char ch = current.charAt(cursor - 1); + char ch = current[cursor - 1]; if (ch > max || ch < min) { cursor--; return true; @@ -172,7 +207,7 @@ protected boolean eq_s(CharSequence s) { } int i; for (i = 0; i != s.length(); i++) { - if (current.charAt(cursor + i) != s.charAt(i)) { + if (current[cursor + i] != s.charAt(i)) { return false; } } @@ -186,7 +221,7 @@ protected boolean eq_s_b(CharSequence s) { } int i; for (i = 0; i != s.length(); i++) { - if (current.charAt(cursor - s.length() + i) != s.charAt(i)) { + if (current[cursor - s.length() + i] != s.charAt(i)) { return false; } } @@ -194,7 +229,7 @@ protected boolean eq_s_b(CharSequence s) { return true; } - protected int find_among(Among v[]) { + protected int find_among(Among[] v) { int i = 0; int j = v.length; @@ -217,7 +252,7 @@ protected int find_among(Among v[]) { diff = -1; break; } - diff = current.charAt(c + common) - w.s[i2]; + diff = current[c + common] - w.s[i2]; if (diff != 0) { break; } @@ -255,13 +290,13 @@ protected int find_among(Among v[]) { if (w.method == null) { return w.result; } - boolean res; + boolean res = false; try { - Object resobj = w.method.invoke(this); - res = resobj.toString().equals("true"); - } catch (InvocationTargetException | IllegalAccessException e) { - res = false; - logger.warn(e.getLocalizedMessage(), e); + res = (boolean) w.method.invokeExact(this); + } catch (Error | RuntimeException e) { + throw e; + } catch (Throwable e) { + throw new UndeclaredThrowableException(e); } cursor = c + w.s.length; if (res) { @@ -276,7 +311,7 @@ protected int find_among(Among v[]) { } // find_among_b is for backwards processing. Same comments apply - protected int find_among_b(Among v[]) { + protected int find_among_b(Among[] v) { int i = 0; int j = v.length; @@ -299,7 +334,7 @@ protected int find_among_b(Among v[]) { diff = -1; break; } - diff = current.charAt(c - 1 - common) - w.s[i2]; + diff = current[c - 1 - common] - w.s[i2]; if (diff != 0) { break; } @@ -333,13 +368,13 @@ protected int find_among_b(Among v[]) { return w.result; } - boolean res; + boolean res = false; try { - Object resobj = w.method.invoke(this); - res = resobj.toString().equals("true"); - } catch (InvocationTargetException | IllegalAccessException e) { - res = false; - logger.warn("Triggered by {}. Exception: {}", current, e.getLocalizedMessage(), e); + res = (boolean) w.method.invokeExact(this); + } catch (Error | RuntimeException e) { + throw e; + } catch (Throwable e) { + throw new UndeclaredThrowableException(e); } cursor = c - w.s.length; if (res) { @@ -356,9 +391,27 @@ protected int find_among_b(Among v[]) { /* to replace chars between c_bra and c_ket in current by the * chars in s. */ - protected int replace_s(int c_bra, int c_ket, String s) { - int adjustment = s.length() - (c_ket - c_bra); - current.replace(c_bra, c_ket, s); + protected int replace_s(int c_bra, int c_ket, CharSequence s) { + final int adjustment = s.length() - (c_ket - c_bra); + final int newLength = length + adjustment; + //resize if necessary + if (newLength > current.length) { + current = Arrays.copyOf(current, newLength); + } + // if the substring being replaced is longer or shorter than the + // replacement, need to shift things around + if (adjustment != 0 && c_ket < length) { + System.arraycopy(current, c_ket, current, c_bra + s.length(), + length - c_ket); + } + // insert the replacement text + // Note, faster is s.getChars(0, s.length(), current, c_bra); + // but would have to duplicate this method for both String and StringBuilder + for (int i = 0; i < s.length(); i++) { + current[c_bra + i] = s.charAt(i); + } + + length += adjustment; limit += adjustment; if (cursor >= c_ket) { cursor += adjustment; @@ -369,34 +422,22 @@ protected int replace_s(int c_bra, int c_ket, String s) { } protected void slice_check() { - if (bra < 0 || - bra > ket || - ket > limit || - limit > current.length()) // this line could be removed - { - logger.error("faulty slice operation"); - /* - fprintf(stderr, "faulty slice operation:\n"); - debug(z, -1, 0); - exit(1); - */ - } + assert bra >= 0 : "bra=" + bra; + assert bra <= ket : "bra=" + bra + ",ket=" + ket; + assert limit <= length : "limit=" + limit + ",length=" + length; + assert ket <= limit : "ket=" + ket + ",limit=" + limit; } - protected void slice_from(String s) { + protected void slice_from(CharSequence s) { slice_check(); replace_s(bra, ket, s); } - protected void slice_from(CharSequence s) { - slice_from(s.toString()); - } - protected void slice_del() { slice_from(""); } - protected void insert(int c_bra, int c_ket, String s) { + protected void insert(int c_bra, int c_ket, CharSequence s) { int adjustment = replace_s(c_bra, c_ket, s); if (c_bra <= bra) { bra += adjustment; @@ -406,14 +447,39 @@ protected void insert(int c_bra, int c_ket, String s) { } } - protected void insert(int c_bra, int c_ket, CharSequence s) { - insert(c_bra, c_ket, s.toString()); - } - /* Copy the slice into the supplied StringBuilder */ protected void slice_to(StringBuilder s) { slice_check(); - s.replace(0, s.length(), current.substring(bra, ket)); + int len = ket - bra; + s.setLength(0); + s.append(current, bra, len); + } + + protected void assign_to(StringBuilder s) { + s.setLength(0); + s.append(current, 0, limit); } +/* +extern void debug(struct SN_env * z, int number, int line_count) +{ int i; + int limit = SIZE(z->p); + //if (number >= 0) printf("%3d (line %4d): '", number, line_count); + if (number >= 0) printf("%3d (line %4d): [%d]'", number, line_count,limit); + for (i = 0; i <= limit; i++) + { if (z->lb == i) printf("{"); + if (z->bra == i) printf("["); + if (z->c == i) printf("|"); + if (z->ket == i) printf("]"); + if (z->l == i) printf("}"); + if (i < limit) + { int ch = z->p[i]; + if (ch == 0) ch = '#'; + printf("%c", ch); + } + } + printf("'\n"); } +*/ + +}; \ No newline at end of file diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/arabicStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/arabicStemmer.java index 369f8353e..72ee603c7 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/arabicStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/arabicStemmer.java @@ -30,20 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; + /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class arabicStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("\u0640", -1, 1), new Among("\u064B", -1, 1), new Among("\u064C", -1, 1), @@ -190,7 +192,7 @@ public class arabicStemmer extends AbstractSnowballStemmer { new Among("\uFEFC", -1, 48) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("\u0622", -1, 1), new Among("\u0623", -1, 1), new Among("\u0624", -1, 1), @@ -198,7 +200,7 @@ public class arabicStemmer extends AbstractSnowballStemmer { new Among("\u0626", -1, 1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("\u0622", -1, 1), new Among("\u0623", -1, 1), new Among("\u0624", -1, 2), @@ -206,14 +208,14 @@ public class arabicStemmer extends AbstractSnowballStemmer { new Among("\u0626", -1, 3) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("\u0627\u0644", -1, 2), new Among("\u0628\u0627\u0644", -1, 1), new Among("\u0643\u0627\u0644", -1, 1), new Among("\u0644\u0644", -1, 2) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("\u0623\u0622", -1, 2), new Among("\u0623\u0623", -1, 1), new Among("\u0623\u0624", -1, 1), @@ -221,39 +223,39 @@ public class arabicStemmer extends AbstractSnowballStemmer { new Among("\u0623\u0627", -1, 3) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("\u0641", -1, 1), new Among("\u0648", -1, 1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("\u0627\u0644", -1, 2), new Among("\u0628\u0627\u0644", -1, 1), new Among("\u0643\u0627\u0644", -1, 1), new Among("\u0644\u0644", -1, 2) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("\u0628", -1, 1), new Among("\u0628\u0627", 0, -1), new Among("\u0628\u0628", 0, 2), new Among("\u0643\u0643", -1, 3) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("\u0633\u0623", -1, 4), new Among("\u0633\u062A", -1, 2), new Among("\u0633\u0646", -1, 3), new Among("\u0633\u064A", -1, 1) }; - private final static Among a_9[] = { + private final static Among[] a_9 = { new Among("\u062A\u0633\u062A", -1, 1), new Among("\u0646\u0633\u062A", -1, 1), new Among("\u064A\u0633\u062A", -1, 1) }; - private final static Among a_10[] = { + private final static Among[] a_10 = { new Among("\u0643\u0645\u0627", -1, 3), new Among("\u0647\u0645\u0627", -1, 3), new Among("\u0646\u0627", -1, 2), @@ -266,33 +268,33 @@ public class arabicStemmer extends AbstractSnowballStemmer { new Among("\u064A", -1, 1) }; - private final static Among a_11[] = { + private final static Among[] a_11 = { new Among("\u0646", -1, 1) }; - private final static Among a_12[] = { + private final static Among[] a_12 = { new Among("\u0627", -1, 1), new Among("\u0648", -1, 1), new Among("\u064A", -1, 1) }; - private final static Among a_13[] = { + private final static Among[] a_13 = { new Among("\u0627\u062A", -1, 1) }; - private final static Among a_14[] = { + private final static Among[] a_14 = { new Among("\u062A", -1, 1) }; - private final static Among a_15[] = { + private final static Among[] a_15 = { new Among("\u0629", -1, 1) }; - private final static Among a_16[] = { + private final static Among[] a_16 = { new Among("\u064A", -1, 1) }; - private final static Among a_17[] = { + private final static Among[] a_17 = { new Among("\u0643\u0645\u0627", -1, 3), new Among("\u0647\u0645\u0627", -1, 3), new Among("\u0646\u0627", -1, 2), @@ -307,7 +309,7 @@ public class arabicStemmer extends AbstractSnowballStemmer { new Among("\u0646\u064A", -1, 2) }; - private final static Among a_18[] = { + private final static Among[] a_18 = { new Among("\u0627", -1, 1), new Among("\u062A\u0627", 0, 2), new Among("\u062A\u0645\u0627", 0, 4), @@ -321,17 +323,17 @@ public class arabicStemmer extends AbstractSnowballStemmer { new Among("\u064A", -1, 1) }; - private final static Among a_19[] = { + private final static Among[] a_19 = { new Among("\u0648\u0627", -1, 1), new Among("\u062A\u0645", -1, 1) }; - private final static Among a_20[] = { + private final static Among[] a_20 = { new Among("\u0648", -1, 1), new Among("\u062A\u0645\u0648", 0, 2) }; - private final static Among a_21[] = { + private final static Among[] a_21 = { new Among("\u0649", -1, 1) }; @@ -606,7 +608,7 @@ private boolean r_Checks1() { ket = cursor; switch (among_var) { case 1: - if (current.length() <= 4) { + if (length <= 4) { return false; } B_is_noun = true; @@ -614,7 +616,7 @@ private boolean r_Checks1() { B_is_defined = true; break; case 2: - if (current.length() <= 3) { + if (length <= 3) { return false; } B_is_noun = true; @@ -635,25 +637,25 @@ private boolean r_Prefix_Step1() { ket = cursor; switch (among_var) { case 1: - if (current.length() <= 3) { + if (length <= 3) { return false; } slice_from("\u0623"); break; case 2: - if (current.length() <= 3) { + if (length <= 3) { return false; } slice_from("\u0622"); break; case 3: - if (current.length() <= 3) { + if (length <= 3) { return false; } slice_from("\u0627"); break; case 4: - if (current.length() <= 3) { + if (length <= 3) { return false; } slice_from("\u0625"); @@ -668,7 +670,7 @@ private boolean r_Prefix_Step2() { return false; } ket = cursor; - if (current.length() <= 3) { + if (length <= 3) { return false; } { @@ -696,13 +698,13 @@ private boolean r_Prefix_Step3a_Noun() { ket = cursor; switch (among_var) { case 1: - if (current.length() <= 5) { + if (length <= 5) { return false; } slice_del(); break; case 2: - if (current.length() <= 4) { + if (length <= 4) { return false; } slice_del(); @@ -721,19 +723,19 @@ private boolean r_Prefix_Step3b_Noun() { ket = cursor; switch (among_var) { case 1: - if (current.length() <= 3) { + if (length <= 3) { return false; } slice_del(); break; case 2: - if (current.length() <= 3) { + if (length <= 3) { return false; } slice_from("\u0628"); break; case 3: - if (current.length() <= 3) { + if (length <= 3) { return false; } slice_from("\u0643"); @@ -752,25 +754,25 @@ private boolean r_Prefix_Step3_Verb() { ket = cursor; switch (among_var) { case 1: - if (current.length() <= 4) { + if (length <= 4) { return false; } slice_from("\u064A"); break; case 2: - if (current.length() <= 4) { + if (length <= 4) { return false; } slice_from("\u062A"); break; case 3: - if (current.length() <= 4) { + if (length <= 4) { return false; } slice_from("\u0646"); break; case 4: - if (current.length() <= 4) { + if (length <= 4) { return false; } slice_from("\u0623"); @@ -785,7 +787,7 @@ private boolean r_Prefix_Step4_Verb() { return false; } ket = cursor; - if (current.length() <= 4) { + if (length <= 4) { return false; } B_is_verb = true; @@ -804,19 +806,19 @@ private boolean r_Suffix_Noun_Step1a() { bra = cursor; switch (among_var) { case 1: - if (current.length() < 4) { + if (length < 4) { return false; } slice_del(); break; case 2: - if (current.length() < 5) { + if (length < 5) { return false; } slice_del(); break; case 3: - if (current.length() < 6) { + if (length < 6) { return false; } slice_del(); @@ -831,7 +833,7 @@ private boolean r_Suffix_Noun_Step1b() { return false; } bra = cursor; - if (current.length() <= 5) { + if (length <= 5) { return false; } slice_del(); @@ -844,7 +846,7 @@ private boolean r_Suffix_Noun_Step2a() { return false; } bra = cursor; - if (current.length() <= 4) { + if (length <= 4) { return false; } slice_del(); @@ -857,7 +859,7 @@ private boolean r_Suffix_Noun_Step2b() { return false; } bra = cursor; - if (current.length() < 5) { + if (length < 5) { return false; } slice_del(); @@ -870,7 +872,7 @@ private boolean r_Suffix_Noun_Step2c1() { return false; } bra = cursor; - if (current.length() < 4) { + if (length < 4) { return false; } slice_del(); @@ -883,7 +885,7 @@ private boolean r_Suffix_Noun_Step2c2() { return false; } bra = cursor; - if (current.length() < 4) { + if (length < 4) { return false; } slice_del(); @@ -896,7 +898,7 @@ private boolean r_Suffix_Noun_Step3() { return false; } bra = cursor; - if (current.length() < 3) { + if (length < 3) { return false; } slice_del(); @@ -913,19 +915,19 @@ private boolean r_Suffix_Verb_Step1() { bra = cursor; switch (among_var) { case 1: - if (current.length() < 4) { + if (length < 4) { return false; } slice_del(); break; case 2: - if (current.length() < 5) { + if (length < 5) { return false; } slice_del(); break; case 3: - if (current.length() < 6) { + if (length < 6) { return false; } slice_del(); @@ -944,25 +946,25 @@ private boolean r_Suffix_Verb_Step2a() { bra = cursor; switch (among_var) { case 1: - if (current.length() < 4) { + if (length < 4) { return false; } slice_del(); break; case 2: - if (current.length() < 5) { + if (length < 5) { return false; } slice_del(); break; case 3: - if (current.length() <= 5) { + if (length <= 5) { return false; } slice_del(); break; case 4: - if (current.length() < 6) { + if (length < 6) { return false; } slice_del(); @@ -977,7 +979,7 @@ private boolean r_Suffix_Verb_Step2b() { return false; } bra = cursor; - if (current.length() < 5) { + if (length < 5) { return false; } slice_del(); @@ -994,13 +996,13 @@ private boolean r_Suffix_Verb_Step2c() { bra = cursor; switch (among_var) { case 1: - if (current.length() < 4) { + if (length < 4) { return false; } slice_del(); break; case 2: - if (current.length() < 6) { + if (length < 6) { return false; } slice_del(); @@ -1019,6 +1021,7 @@ private boolean r_Suffix_All_alef_maqsura() { return true; } + @Override public boolean stem() { B_is_noun = true; B_is_verb = true; diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/catalanStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/catalanStemmer.java index 0d4d55c79..828d365da 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/catalanStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/catalanStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class catalanStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("", -1, 7), new Among("\u00B7", 0, 6), new Among("\u00E0", 0, 1), @@ -60,7 +61,7 @@ public class catalanStemmer extends AbstractSnowballStemmer { new Among("\u00FC", 0, 5) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("la", -1, 1), new Among("-la", 0, 1), new Among("sela", 0, 1), @@ -102,7 +103,7 @@ public class catalanStemmer extends AbstractSnowballStemmer { new Among("'t", -1, 1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ica", -1, 4), new Among("l\u00F3gica", 0, 3), new Among("enca", -1, 1), @@ -305,7 +306,7 @@ public class catalanStemmer extends AbstractSnowballStemmer { new Among("aci\u00F3", 198, 1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("aba", -1, 1), new Among("esca", -1, 1), new Among("isca", -1, 1), @@ -591,7 +592,7 @@ public class catalanStemmer extends AbstractSnowballStemmer { new Among("i\u00F3", -1, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("a", -1, 1), new Among("e", -1, 1), new Among("i", -1, 1), @@ -616,7 +617,7 @@ public class catalanStemmer extends AbstractSnowballStemmer { new Among("\u00F3", -1, 1) }; - private static final char g_v[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, 81, 6, 10}; + private static final char[] g_v = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, 81, 6, 10}; private int I_p2; private int I_p1; @@ -848,6 +849,7 @@ private boolean r_residual_suffix() { return true; } + @Override public boolean stem() { r_mark_regions(); limit_backward = cursor; diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/danishStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/danishStemmer.java index 0945b920f..5314cbc26 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/danishStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/danishStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class danishStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("hed", -1, 1), new Among("ethed", 0, 1), new Among("ered", -1, 1), @@ -79,14 +80,14 @@ public class danishStemmer extends AbstractSnowballStemmer { new Among("eret", 30, 1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("gd", -1, -1), new Among("dt", -1, -1), new Among("gt", -1, -1), new Among("kt", -1, -1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ig", -1, 1), new Among("lig", 0, 1), new Among("elig", 1, 1), @@ -94,11 +95,11 @@ public class danishStemmer extends AbstractSnowballStemmer { new Among("l\u00F8st", -1, 2) }; - private static final char g_c[] = {119, 223, 119, 1}; + private static final char[] g_c = {119, 223, 119, 1}; - private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128}; + private static final char[] g_v = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128}; - private static final char g_s_ending[] = {239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}; + private static final char[] g_s_ending = {239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}; private int I_x; private int I_p1; @@ -276,6 +277,7 @@ private boolean r_undouble() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_mark_regions(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/dutchStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/dutchStemmer.java index 557ccf7f6..6da29571a 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/dutchStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/dutchStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class dutchStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("", -1, 6), new Among("\u00E1", 0, 1), new Among("\u00E4", 0, 1), @@ -58,19 +59,19 @@ public class dutchStemmer extends AbstractSnowballStemmer { new Among("\u00FC", 0, 5) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("", -1, 3), new Among("I", 0, 2), new Among("Y", 0, 1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("dd", -1, -1), new Among("kk", -1, -1), new Among("tt", -1, -1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("ene", -1, 2), new Among("se", -1, 3), new Among("en", -1, 2), @@ -78,7 +79,7 @@ public class dutchStemmer extends AbstractSnowballStemmer { new Among("s", -1, 3) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("end", -1, 1), new Among("ig", -1, 2), new Among("ing", -1, 1), @@ -87,18 +88,18 @@ public class dutchStemmer extends AbstractSnowballStemmer { new Among("bar", -1, 5) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("aa", -1, -1), new Among("ee", -1, -1), new Among("oo", -1, -1), new Among("uu", -1, -1) }; - private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; + private static final char[] g_v = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; - private static final char g_v_I[] = {1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; + private static final char[] g_v_I = {1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; - private static final char g_v_j[] = {17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; + private static final char[] g_v_j = {17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; private int I_p2; private int I_p1; @@ -572,6 +573,7 @@ private boolean r_standard_suffix() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_prelude(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/englishStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/englishStemmer.java index e3ba45de0..ed062d310 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/englishStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/englishStemmer.java @@ -30,33 +30,34 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class englishStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("arsen", -1, -1), new Among("commun", -1, -1), new Among("gener", -1, -1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("'", -1, 1), new Among("'s'", 0, 1), new Among("'s", -1, 1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ied", -1, 2), new Among("s", -1, 3), new Among("ies", 1, 2), @@ -65,7 +66,7 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("us", 1, -1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("", -1, 3), new Among("bb", 0, 2), new Among("dd", 0, 2), @@ -81,7 +82,7 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("iz", 0, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("ed", -1, 2), new Among("eed", 0, 1), new Among("ing", -1, 2), @@ -90,7 +91,7 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("ingly", -1, 2) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("anci", -1, 3), new Among("enci", -1, 2), new Among("ogi", -1, 13), @@ -117,7 +118,7 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("ousness", -1, 10) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("icate", -1, 4), new Among("ative", -1, 6), new Among("alize", -1, 3), @@ -129,7 +130,7 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("ness", -1, 5) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("ic", -1, 1), new Among("ance", -1, 1), new Among("ence", -1, 1), @@ -150,12 +151,12 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("ement", 16, 1) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("e", -1, 1), new Among("l", -1, 2) }; - private final static Among a_9[] = { + private final static Among[] a_9 = { new Among("succeed", -1, -1), new Among("proceed", -1, -1), new Among("exceed", -1, -1), @@ -166,7 +167,7 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("outing", -1, -1) }; - private final static Among a_10[] = { + private final static Among[] a_10 = { new Among("andes", -1, -1), new Among("atlas", -1, -1), new Among("bias", -1, -1), @@ -187,13 +188,13 @@ public class englishStemmer extends AbstractSnowballStemmer { new Among("ugly", -1, 8) }; - private static final char g_aeo[] = {17, 64}; + private static final char[] g_aeo = {17, 64}; - private static final char g_v[] = {17, 65, 16, 1}; + private static final char[] g_v = {17, 65, 16, 1}; - private static final char g_v_WXY[] = {1, 17, 65, 208, 1}; + private static final char[] g_v_WXY = {1, 17, 65, 208, 1}; - private static final char g_valid_LI[] = {55, 141, 2}; + private static final char[] g_valid_LI = {55, 141, 2}; private boolean B_Y_found; private int I_p2; @@ -720,7 +721,6 @@ private boolean r_Step_5() { case 1: lab0: { - int v_1 = limit - cursor; lab1: { if (!r_R2()) { @@ -728,7 +728,6 @@ private boolean r_Step_5() { } break lab0; } - cursor = limit - v_1; if (!r_R1()) { return false; } @@ -856,6 +855,7 @@ private boolean r_postlude() { return true; } + @Override public boolean stem() { lab0: { diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/finnishStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/finnishStemmer.java index 9bf7aeba5..ef28bb7fc 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/finnishStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/finnishStemmer.java @@ -30,21 +30,23 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class finnishStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; + private static final java.lang.invoke.MethodHandles.Lookup methodObject = java.lang.invoke.MethodHandles.lookup(); - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("pa", -1, 1), new Among("sti", -1, 2), new Among("kaan", -1, 1), @@ -57,7 +59,7 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("k\u00F6", -1, 1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("lla", -1, -1), new Among("na", -1, -1), new Among("ssa", -1, -1), @@ -66,7 +68,7 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("sta", 3, -1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ll\u00E4", -1, -1), new Among("n\u00E4", -1, -1), new Among("ss\u00E4", -1, -1), @@ -75,12 +77,12 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("st\u00E4", 3, -1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("lle", -1, -1), new Among("ine", -1, -1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("nsa", -1, 3), new Among("mme", -1, 3), new Among("nne", -1, 3), @@ -92,7 +94,7 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("ns\u00E4", -1, 3) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("aa", -1, -1), new Among("ee", -1, -1), new Among("ii", -1, -1), @@ -102,7 +104,7 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("\u00F6\u00F6", -1, -1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("a", -1, 8), new Among("lla", 0, -1), new Among("na", 0, -1), @@ -116,12 +118,12 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("ksi", -1, -1), new Among("n", -1, 7), new Among("han", 11, 1), - new Among("den", 11, -1, "r_VI", finnishStemmer.class), - new Among("seen", 11, -1, "r_LONG", finnishStemmer.class), + new Among("den", 11, -1, "r_VI", methodObject), + new Among("seen", 11, -1, "r_LONG", methodObject), new Among("hen", 11, 2), - new Among("tten", 11, -1, "r_VI", finnishStemmer.class), + new Among("tten", 11, -1, "r_VI", methodObject), new Among("hin", 11, 3), - new Among("siin", 11, -1, "r_VI", finnishStemmer.class), + new Among("siin", 11, -1, "r_VI", methodObject), new Among("hon", 11, 4), new Among("h\u00E4n", 11, 5), new Among("h\u00F6n", 11, 6), @@ -135,7 +137,7 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("tt\u00E4", 26, 2) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("eja", -1, -1), new Among("mma", -1, 1), new Among("imma", 1, -1), @@ -152,25 +154,25 @@ public class finnishStemmer extends AbstractSnowballStemmer { new Among("imp\u00E4", 12, -1) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("i", -1, -1), new Among("j", -1, -1) }; - private final static Among a_9[] = { + private final static Among[] a_9 = { new Among("mma", -1, 1), new Among("imma", 0, -1) }; - private static final char g_AEI[] = {17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8}; + private static final char[] g_AEI = {17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8}; - private static final char g_C[] = {119, 223, 119, 1}; + private static final char[] g_C = {119, 223, 119, 1}; - private static final char g_V1[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32}; + private static final char[] g_V1 = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32}; - private static final char g_V2[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32}; + private static final char[] g_V2 = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32}; - private static final char g_particle_end[] = {17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32}; + private static final char[] g_particle_end = {17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32}; private boolean B_ending_removed; private java.lang.StringBuilder S_x = new java.lang.StringBuilder(); @@ -346,14 +348,14 @@ private boolean r_possessive() { return true; } - public boolean r_LONG() { + private boolean r_LONG() { if (find_among_b(a_5) == 0) { return false; } return true; } - public boolean r_VI() { + private boolean r_VI() { if (!(eq_s_b("i"))) { return false; } @@ -663,6 +665,7 @@ private boolean r_tidy() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_mark_regions(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/frenchStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/frenchStemmer.java index 83a1f76d2..7d37b3d11 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/frenchStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/frenchStemmer.java @@ -30,27 +30,28 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class frenchStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("col", -1, -1), new Among("par", -1, -1), new Among("tap", -1, -1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("", -1, 7), new Among("H", 0, 6), new Among("He", 1, 4), @@ -60,7 +61,7 @@ public class frenchStemmer extends AbstractSnowballStemmer { new Among("Y", 0, 3) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("iqU", -1, 3), new Among("abl", -1, 3), new Among("I\u00E8r", -1, 4), @@ -69,13 +70,13 @@ public class frenchStemmer extends AbstractSnowballStemmer { new Among("iv", -1, 1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("ic", -1, 2), new Among("abil", -1, 1), new Among("iv", -1, 3) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("iqUe", -1, 1), new Among("atrice", -1, 2), new Among("ance", -1, 1), @@ -121,7 +122,7 @@ public class frenchStemmer extends AbstractSnowballStemmer { new Among("it\u00E9", -1, 7) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("ira", -1, 1), new Among("ie", -1, 1), new Among("isse", -1, 1), @@ -159,7 +160,7 @@ public class frenchStemmer extends AbstractSnowballStemmer { new Among("issez", -1, 1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("a", -1, 3), new Among("era", 0, 2), new Among("asse", -1, 3), @@ -200,7 +201,7 @@ public class frenchStemmer extends AbstractSnowballStemmer { new Among("\u00E9", -1, 2) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("e", -1, 3), new Among("I\u00E8re", 0, 2), new Among("i\u00E8re", 0, 2), @@ -209,7 +210,7 @@ public class frenchStemmer extends AbstractSnowballStemmer { new Among("ier", -1, 2) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("ell", -1, -1), new Among("eill", -1, -1), new Among("enn", -1, -1), @@ -217,9 +218,9 @@ public class frenchStemmer extends AbstractSnowballStemmer { new Among("ett", -1, -1) }; - private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5}; + private static final char[] g_v = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5}; - private static final char g_keep_with_s[] = {1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; + private static final char[] g_keep_with_s = {1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128}; private int I_p2; private int I_p1; @@ -1029,6 +1030,7 @@ private boolean r_un_accent() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_prelude(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/germanStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/germanStemmer.java index 702a3c841..d00c0c4b2 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/germanStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/germanStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class germanStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("", -1, 5), new Among("ae", 0, 2), new Among("oe", 0, 3), @@ -53,7 +54,7 @@ public class germanStemmer extends AbstractSnowballStemmer { new Among("\u00DF", 0, 1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("", -1, 5), new Among("U", 0, 2), new Among("Y", 0, 1), @@ -62,29 +63,33 @@ public class germanStemmer extends AbstractSnowballStemmer { new Among("\u00FC", 0, 2) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("e", -1, 3), new Among("em", -1, 1), new Among("en", -1, 3), + new Among("erinnen", 2, 2), + new Among("erin", -1, 2), + new Among("ln", -1, 5), new Among("ern", -1, 2), new Among("er", -1, 2), new Among("s", -1, 4), - new Among("es", 5, 3) + new Among("es", 8, 3), + new Among("lns", 8, 5) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("en", -1, 1), new Among("er", -1, 1), new Among("st", -1, 2), new Among("est", 2, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("ig", -1, 1), new Among("lich", -1, 1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("end", -1, 1), new Among("ig", -1, 2), new Among("ung", -1, 1), @@ -95,11 +100,11 @@ public class germanStemmer extends AbstractSnowballStemmer { new Among("keit", -1, 4) }; - private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8}; + private static final char[] g_v = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8}; - private static final char g_s_ending[] = {117, 30, 5}; + private static final char[] g_s_ending = {117, 30, 5}; - private static final char g_st_ending[] = {117, 30, 4}; + private static final char[] g_st_ending = {117, 30, 4}; private int I_x; private int I_p2; @@ -378,6 +383,9 @@ private boolean r_standard_suffix() { } slice_del(); break; + case 5: + slice_from("l"); + break; } } cursor = limit - v_1; @@ -523,6 +531,7 @@ private boolean r_standard_suffix() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_prelude(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/greekStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/greekStemmer.java index 7c4f19310..14af6bada 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/greekStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/greekStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class greekStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("", -1, 25), new Among("\u0386", 0, 1), new Among("\u0388", 0, 5), @@ -93,7 +94,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03CE", 0, 24) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("\u03C3\u03BA\u03B1\u03B3\u03B9\u03B1", -1, 2), new Among("\u03C6\u03B1\u03B3\u03B9\u03B1", -1, 1), new Among("\u03BF\u03BB\u03BF\u03B3\u03B9\u03B1", -1, 3), @@ -136,7 +137,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C4\u03B1\u03C4\u03BF\u03B3\u03B9\u03BF\u03C5", -1, 5) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("\u03C0\u03B1", -1, 1), new Among("\u03BE\u03B1\u03BD\u03B1\u03C0\u03B1", 0, 1), new Among("\u03B5\u03C0\u03B1", 0, 1), @@ -170,7 +171,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BB\u03BF\u03C5", -1, 2) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("\u03B9\u03B6\u03B1", -1, 1), new Among("\u03B9\u03B6\u03B5", -1, 1), new Among("\u03B9\u03B6\u03B1\u03BC\u03B5", -1, 1), @@ -187,7 +188,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B9\u03B6\u03C9", -1, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("\u03B2\u03B9", -1, 1), new Among("\u03BB\u03B9", -1, 1), new Among("\u03B1\u03BB", -1, 1), @@ -198,7 +199,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B6\u03C9", -1, 1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("\u03C9\u03B8\u03B7\u03BA\u03B1", -1, 1), new Among("\u03C9\u03B8\u03B7\u03BA\u03B5", -1, 1), new Among("\u03C9\u03B8\u03B7\u03BA\u03B1\u03BC\u03B5", -1, 1), @@ -208,7 +209,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C9\u03B8\u03B7\u03BA\u03B5\u03C3", -1, 1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("\u03BE\u03B1\u03BD\u03B1\u03C0\u03B1", -1, 1), new Among("\u03B5\u03C0\u03B1", -1, 1), new Among("\u03C0\u03B5\u03C1\u03B9\u03C0\u03B1", -1, 1), @@ -243,7 +244,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B3\u03B9\u03B3\u03B1\u03BD\u03C4\u03BF\u03B1\u03C6", 30, 2) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("\u03B9\u03C3\u03B1", -1, 1), new Among("\u03B9\u03C3\u03B1\u03BC\u03B5", -1, 1), new Among("\u03B9\u03C3\u03B1\u03BD\u03B5", -1, 1), @@ -253,7 +254,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B9\u03C3\u03B5\u03C3", -1, 1) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("\u03BE\u03B1\u03BD\u03B1\u03C0\u03B1", -1, 1), new Among("\u03B5\u03C0\u03B1", -1, 1), new Among("\u03C0\u03B5\u03C1\u03B9\u03C0\u03B1", -1, 1), @@ -275,7 +276,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C3\u03C5\u03BD\u03B1\u03B8\u03C1\u03BF", 17, 1) }; - private final static Among a_9[] = { + private final static Among[] a_9 = { new Among("\u03B9\u03C3\u03BF\u03C5\u03BC\u03B5", -1, 1), new Among("\u03B9\u03C3\u03BF\u03C5\u03BD\u03B5", -1, 1), new Among("\u03B9\u03C3\u03B5\u03C4\u03B5", -1, 1), @@ -285,7 +286,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B9\u03C3\u03C9", -1, 1) }; - private final static Among a_10[] = { + private final static Among[] a_10 = { new Among("\u03B1\u03C4\u03B1", -1, 2), new Among("\u03C6\u03B1", -1, 2), new Among("\u03B7\u03C6\u03B1", 1, 2), @@ -328,7 +329,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C5\u03C8", -1, 2) }; - private final static Among a_11[] = { + private final static Among[] a_11 = { new Among("\u03B9\u03C3\u03C4\u03B1", -1, 1), new Among("\u03B9\u03C3\u03C4\u03B5", -1, 1), new Among("\u03B9\u03C3\u03C4\u03B7", -1, 1), @@ -342,7 +343,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B9\u03C3\u03C4\u03BF\u03C5", -1, 1) }; - private final static Among a_12[] = { + private final static Among[] a_12 = { new Among("\u03B5\u03B3\u03BA\u03BB\u03B5", -1, 1), new Among("\u03B1\u03C0\u03BF\u03BA\u03BB\u03B5", -1, 1), new Among("\u03B4\u03B1\u03BD\u03B5", -1, 2), @@ -352,7 +353,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BC\u03B9\u03BA\u03C1\u03BF\u03C3\u03B5", 4, 1) }; - private final static Among a_13[] = { + private final static Among[] a_13 = { new Among("\u03B1\u03C4\u03BF\u03BC\u03B9\u03BA", -1, 2), new Among("\u03B5\u03B8\u03BD\u03B9\u03BA", -1, 4), new Among("\u03C4\u03BF\u03C0\u03B9\u03BA", -1, 7), @@ -365,7 +366,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B2\u03C5\u03B6\u03B1\u03BD\u03C4\u03B9\u03BD", -1, 9) }; - private final static Among a_14[] = { + private final static Among[] a_14 = { new Among("\u03B9\u03C3\u03BC\u03BF\u03B9", -1, 1), new Among("\u03B9\u03C3\u03BC\u03C9\u03BD", -1, 1), new Among("\u03B9\u03C3\u03BC\u03BF", -1, 1), @@ -374,19 +375,19 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B9\u03C3\u03BC\u03BF\u03C5", -1, 1) }; - private final static Among a_15[] = { + private final static Among[] a_15 = { new Among("\u03C3", -1, 1), new Among("\u03C7", -1, 1) }; - private final static Among a_16[] = { + private final static Among[] a_16 = { new Among("\u03BF\u03C5\u03B4\u03B1\u03BA\u03B9\u03B1", -1, 1), new Among("\u03B1\u03C1\u03B1\u03BA\u03B9\u03B1", -1, 1), new Among("\u03BF\u03C5\u03B4\u03B1\u03BA\u03B9", -1, 1), new Among("\u03B1\u03C1\u03B1\u03BA\u03B9", -1, 1) }; - private final static Among a_17[] = { + private final static Among[] a_17 = { new Among("\u03B2", -1, 2), new Among("\u03B2\u03B1\u03BC\u03B2", 0, 1), new Among("\u03C3\u03BB\u03BF\u03B2", 0, 1), @@ -435,7 +436,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C7", -1, 1) }; - private final static Among a_18[] = { + private final static Among[] a_18 = { new Among("\u03B1\u03BA\u03B9\u03B1", -1, 1), new Among("\u03B1\u03C1\u03B1\u03BA\u03B9\u03B1", 0, 1), new Among("\u03B9\u03C4\u03C3\u03B1", -1, 1), @@ -446,25 +447,25 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B9\u03C4\u03C3\u03B5\u03C3", -1, 1) }; - private final static Among a_19[] = { + private final static Among[] a_19 = { new Among("\u03C8\u03B1\u03BB", -1, 1), new Among("\u03B1\u03B9\u03C6\u03BD", -1, 1), new Among("\u03BF\u03BB\u03BF", -1, 1), new Among("\u03B9\u03C1", -1, 1) }; - private final static Among a_20[] = { + private final static Among[] a_20 = { new Among("\u03B5", -1, 1), new Among("\u03C0\u03B1\u03B9\u03C7\u03BD", -1, 1) }; - private final static Among a_21[] = { + private final static Among[] a_21 = { new Among("\u03B9\u03B4\u03B9\u03B1", -1, 1), new Among("\u03B9\u03B4\u03B9\u03C9\u03BD", -1, 1), new Among("\u03B9\u03B4\u03B9\u03BF", -1, 1) }; - private final static Among a_22[] = { + private final static Among[] a_22 = { new Among("\u03B9\u03B2", -1, 1), new Among("\u03B4", -1, 1), new Among("\u03C6\u03C1\u03B1\u03B3\u03BA", -1, 1), @@ -474,19 +475,19 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C1", -1, 1) }; - private final static Among a_23[] = { + private final static Among[] a_23 = { new Among("\u03B9\u03C3\u03BA\u03B5", -1, 1), new Among("\u03B9\u03C3\u03BA\u03BF", -1, 1), new Among("\u03B9\u03C3\u03BA\u03BF\u03C3", -1, 1), new Among("\u03B9\u03C3\u03BA\u03BF\u03C5", -1, 1) }; - private final static Among a_24[] = { + private final static Among[] a_24 = { new Among("\u03B1\u03B4\u03C9\u03BD", -1, 1), new Among("\u03B1\u03B4\u03B5\u03C3", -1, 1) }; - private final static Among a_25[] = { + private final static Among[] a_25 = { new Among("\u03B3\u03B9\u03B1\u03B3\u03B9", -1, -1), new Among("\u03B8\u03B5\u03B9", -1, -1), new Among("\u03BF\u03BA", -1, -1), @@ -499,12 +500,12 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BD\u03C4\u03B1\u03BD\u03C4", -1, -1) }; - private final static Among a_26[] = { + private final static Among[] a_26 = { new Among("\u03B5\u03B4\u03C9\u03BD", -1, 1), new Among("\u03B5\u03B4\u03B5\u03C3", -1, 1) }; - private final static Among a_27[] = { + private final static Among[] a_27 = { new Among("\u03BC\u03B9\u03BB", -1, 1), new Among("\u03B4\u03B1\u03C0", -1, 1), new Among("\u03B3\u03B7\u03C0", -1, 1), @@ -515,12 +516,12 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C5\u03C0", -1, 1) }; - private final static Among a_28[] = { + private final static Among[] a_28 = { new Among("\u03BF\u03C5\u03B4\u03C9\u03BD", -1, 1), new Among("\u03BF\u03C5\u03B4\u03B5\u03C3", -1, 1) }; - private final static Among a_29[] = { + private final static Among[] a_29 = { new Among("\u03C4\u03C1\u03B1\u03B3", -1, 1), new Among("\u03C6\u03B5", -1, 1), new Among("\u03BA\u03B1\u03BB\u03B9\u03B1\u03BA", -1, 1), @@ -538,12 +539,12 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BB\u03B9\u03C7", -1, 1) }; - private final static Among a_30[] = { + private final static Among[] a_30 = { new Among("\u03B5\u03C9\u03BD", -1, 1), new Among("\u03B5\u03C9\u03C3", -1, 1) }; - private final static Among a_31[] = { + private final static Among[] a_31 = { new Among("\u03B4", -1, 1), new Among("\u03B9\u03B4", 0, 1), new Among("\u03B8", -1, 1), @@ -554,20 +555,20 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C0\u03B1\u03C1", -1, 1) }; - private final static Among a_32[] = { + private final static Among[] a_32 = { new Among("\u03B9\u03B1", -1, 1), new Among("\u03B9\u03C9\u03BD", -1, 1), new Among("\u03B9\u03BF\u03C5", -1, 1) }; - private final static Among a_33[] = { + private final static Among[] a_33 = { new Among("\u03B9\u03BA\u03B1", -1, 1), new Among("\u03B9\u03BA\u03C9\u03BD", -1, 1), new Among("\u03B9\u03BA\u03BF", -1, 1), new Among("\u03B9\u03BA\u03BF\u03C5", -1, 1) }; - private final static Among a_34[] = { + private final static Among[] a_34 = { new Among("\u03B1\u03B4", -1, 1), new Among("\u03C3\u03C5\u03BD\u03B1\u03B4", 0, 1), new Among("\u03BA\u03B1\u03C4\u03B1\u03B4", 0, 1), @@ -606,7 +607,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C3\u03B5\u03C1\u03C4", -1, 1) }; - private final static Among a_35[] = { + private final static Among[] a_35 = { new Among("\u03B1\u03B3\u03B1\u03BC\u03B5", -1, 1), new Among("\u03B7\u03BA\u03B1\u03BC\u03B5", -1, 1), new Among("\u03B7\u03B8\u03B7\u03BA\u03B1\u03BC\u03B5", 1, 1), @@ -614,7 +615,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BF\u03C5\u03C3\u03B1\u03BC\u03B5", -1, 1) }; - private final static Among a_36[] = { + private final static Among[] a_36 = { new Among("\u03B2\u03BF\u03C5\u03B2", -1, 1), new Among("\u03BE\u03B5\u03B8", -1, 1), new Among("\u03C0\u03B5\u03B8", -1, 1), @@ -629,12 +630,12 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C3\u03B9\u03C7", 10, 1) }; - private final static Among a_37[] = { + private final static Among[] a_37 = { new Among("\u03C4\u03C1", -1, 1), new Among("\u03C4\u03C3", -1, 1) }; - private final static Among a_38[] = { + private final static Among[] a_38 = { new Among("\u03B1\u03B3\u03B1\u03BD\u03B5", -1, 1), new Among("\u03B7\u03BA\u03B1\u03BD\u03B5", -1, 1), new Among("\u03B7\u03B8\u03B7\u03BA\u03B1\u03BD\u03B5", 1, 1), @@ -648,7 +649,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B9\u03BF\u03C4\u03B1\u03BD\u03B5", 9, 1) }; - private final static Among a_39[] = { + private final static Among[] a_39 = { new Among("\u03C4\u03B1\u03B2", -1, 1), new Among("\u03BD\u03C4\u03B1\u03B2", 0, 1), new Among("\u03C8\u03B7\u03BB\u03BF\u03C4\u03B1\u03B2", 0, 1), @@ -746,11 +747,11 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BB\u03B9\u03C7", 87, 1) }; - private final static Among a_40[] = { + private final static Among[] a_40 = { new Among("\u03B7\u03C3\u03B5\u03C4\u03B5", -1, 1) }; - private final static Among a_41[] = { + private final static Among[] a_41 = { new Among("\u03B5\u03BD\u03B4", -1, 1), new Among("\u03C3\u03C5\u03BD\u03B4", -1, 1), new Among("\u03BF\u03B4", -1, 1), @@ -784,7 +785,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C3\u03C7", -1, 1) }; - private final static Among a_42[] = { + private final static Among[] a_42 = { new Among("\u03C0\u03B1\u03B3", -1, 1), new Among("\u03B4", -1, 1), new Among("\u03B1\u03B4", 1, 1), @@ -812,17 +813,17 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C3\u03C5\u03C1\u03C6", -1, 1) }; - private final static Among a_43[] = { + private final static Among[] a_43 = { new Among("\u03BF\u03BD\u03C4\u03B1\u03C3", -1, 1), new Among("\u03C9\u03BD\u03C4\u03B1\u03C3", -1, 1) }; - private final static Among a_44[] = { + private final static Among[] a_44 = { new Among("\u03BF\u03BC\u03B1\u03C3\u03C4\u03B5", -1, 1), new Among("\u03B9\u03BF\u03BC\u03B1\u03C3\u03C4\u03B5", 0, 1) }; - private final static Among a_45[] = { + private final static Among[] a_45 = { new Among("\u03C0", -1, 1), new Among("\u03B1\u03C0", 0, 1), new Among("\u03B1\u03BA\u03B1\u03C4\u03B1\u03C0", 1, 1), @@ -831,7 +832,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B1\u03BC\u03B5\u03C4\u03B1\u03BC\u03C6", -1, 1) }; - private final static Among a_46[] = { + private final static Among[] a_46 = { new Among("\u03B6", -1, 1), new Among("\u03B1\u03BB", -1, 1), new Among("\u03C0\u03B1\u03C1\u03B1\u03BA\u03B1\u03BB", 1, 1), @@ -843,13 +844,13 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BD\u03B9\u03C3", -1, 1) }; - private final static Among a_47[] = { + private final static Among[] a_47 = { new Among("\u03B7\u03B8\u03B7\u03BA\u03B1", -1, 1), new Among("\u03B7\u03B8\u03B7\u03BA\u03B5", -1, 1), new Among("\u03B7\u03B8\u03B7\u03BA\u03B5\u03C3", -1, 1) }; - private final static Among a_48[] = { + private final static Among[] a_48 = { new Among("\u03C0\u03B9\u03B8", -1, 1), new Among("\u03BF\u03B8", -1, 1), new Among("\u03BD\u03B1\u03C1\u03B8", -1, 1), @@ -858,7 +859,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C3\u03C6", -1, 1) }; - private final static Among a_49[] = { + private final static Among[] a_49 = { new Among("\u03B8", -1, 1), new Among("\u03B4\u03B9\u03B1\u03B8", 0, 1), new Among("\u03C0\u03B1\u03C1\u03B1\u03BA\u03B1\u03C4\u03B1\u03B8", 0, 1), @@ -866,13 +867,13 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C0\u03C1\u03BF\u03C3\u03B8", 0, 1) }; - private final static Among a_50[] = { + private final static Among[] a_50 = { new Among("\u03B7\u03BA\u03B1", -1, 1), new Among("\u03B7\u03BA\u03B5", -1, 1), new Among("\u03B7\u03BA\u03B5\u03C3", -1, 1) }; - private final static Among a_51[] = { + private final static Among[] a_51 = { new Among("\u03C6\u03B1\u03B3", -1, 1), new Among("\u03BB\u03B7\u03B3", -1, 1), new Among("\u03C6\u03C1\u03C5\u03B4", -1, 1), @@ -887,7 +888,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C0\u03B1\u03BD\u03C4\u03B1\u03C7", -1, 1) }; - private final static Among a_52[] = { + private final static Among[] a_52 = { new Among("\u03C4\u03C3\u03B1", -1, 1), new Among("\u03C7\u03B1\u03B4", -1, 1), new Among("\u03BC\u03B5\u03B4", -1, 1), @@ -915,13 +916,13 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BB\u03B5\u03C7", -1, 1) }; - private final static Among a_53[] = { + private final static Among[] a_53 = { new Among("\u03BF\u03C5\u03C3\u03B1", -1, 1), new Among("\u03BF\u03C5\u03C3\u03B5", -1, 1), new Among("\u03BF\u03C5\u03C3\u03B5\u03C3", -1, 1) }; - private final static Among a_54[] = { + private final static Among[] a_54 = { new Among("\u03C0\u03B5\u03BB", -1, 1), new Among("\u03BB\u03BB", -1, 1), new Among("\u03C3\u03BC\u03B7\u03BD", -1, 1), @@ -936,7 +937,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BD\u03B1\u03C5\u03BB\u03BF\u03C7", 10, -1) }; - private final static Among a_55[] = { + private final static Among[] a_55 = { new Among("\u03B1\u03BC\u03B1\u03BB\u03BB\u03B9", -1, 1), new Among("\u03BB", -1, 1), new Among("\u03B1\u03BC\u03B1\u03BB", 1, 1), @@ -983,19 +984,19 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C0\u03BF\u03BB\u03C5\u03C6", -1, 1) }; - private final static Among a_56[] = { + private final static Among[] a_56 = { new Among("\u03B1\u03B3\u03B1", -1, 1), new Among("\u03B1\u03B3\u03B5", -1, 1), new Among("\u03B1\u03B3\u03B5\u03C3", -1, 1) }; - private final static Among a_57[] = { + private final static Among[] a_57 = { new Among("\u03B7\u03C3\u03B1", -1, 1), new Among("\u03B7\u03C3\u03B5", -1, 1), new Among("\u03B7\u03C3\u03BF\u03C5", -1, 1) }; - private final static Among a_58[] = { + private final static Among[] a_58 = { new Among("\u03BD", -1, 1), new Among("\u03B4\u03C9\u03B4\u03B5\u03BA\u03B1\u03BD", 0, 1), new Among("\u03B5\u03C0\u03C4\u03B1\u03BD", 0, 1), @@ -1004,11 +1005,11 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C7\u03B5\u03C1\u03C3\u03BF\u03BD", 0, 1) }; - private final static Among a_59[] = { + private final static Among[] a_59 = { new Among("\u03B7\u03C3\u03C4\u03B5", -1, 1) }; - private final static Among a_60[] = { + private final static Among[] a_60 = { new Among("\u03C3\u03B2", -1, 1), new Among("\u03B1\u03C3\u03B2", 0, 1), new Among("\u03B1\u03C0\u03BB", -1, 1), @@ -1021,13 +1022,13 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C0\u03B1\u03BB\u03B9\u03BC\u03C8", -1, 1) }; - private final static Among a_61[] = { + private final static Among[] a_61 = { new Among("\u03BF\u03C5\u03BD\u03B5", -1, 1), new Among("\u03B7\u03B8\u03BF\u03C5\u03BD\u03B5", 0, 1), new Among("\u03B7\u03C3\u03BF\u03C5\u03BD\u03B5", 0, 1) }; - private final static Among a_62[] = { + private final static Among[] a_62 = { new Among("\u03C3\u03C0\u03B9", -1, 1), new Among("\u03BD", -1, 1), new Among("\u03B5\u03BE\u03C9\u03BD", 1, 1), @@ -1036,13 +1037,13 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03BA\u03B1\u03BA\u03BF\u03BC\u03BF\u03C5\u03C4\u03C3", -1, 1) }; - private final static Among a_63[] = { + private final static Among[] a_63 = { new Among("\u03BF\u03C5\u03BC\u03B5", -1, 1), new Among("\u03B7\u03B8\u03BF\u03C5\u03BC\u03B5", 0, 1), new Among("\u03B7\u03C3\u03BF\u03C5\u03BC\u03B5", 0, 1) }; - private final static Among a_64[] = { + private final static Among[] a_64 = { new Among("\u03B1\u03B6", -1, 1), new Among("\u03C9\u03C1\u03B9\u03BF\u03C0\u03BB", -1, 1), new Among("\u03B1\u03C3\u03BF\u03C5\u03C3", -1, 1), @@ -1052,13 +1053,13 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C7", -1, 1) }; - private final static Among a_65[] = { + private final static Among[] a_65 = { new Among("\u03BC\u03B1\u03C4\u03B1", -1, 1), new Among("\u03BC\u03B1\u03C4\u03C9\u03BD", -1, 1), new Among("\u03BC\u03B1\u03C4\u03BF\u03C3", -1, 1) }; - private final static Among a_66[] = { + private final static Among[] a_66 = { new Among("\u03B1", -1, 1), new Among("\u03B9\u03BF\u03C5\u03BC\u03B1", 0, 1), new Among("\u03BF\u03BC\u03BF\u03C5\u03BD\u03B1", 0, 1), @@ -1145,7 +1146,7 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03B7\u03C3\u03C9", 80, 1) }; - private final static Among a_67[] = { + private final static Among[] a_67 = { new Among("\u03BF\u03C4\u03B5\u03C1", -1, 1), new Among("\u03B5\u03C3\u03C4\u03B5\u03C1", -1, 1), new Among("\u03C5\u03C4\u03B5\u03C1", -1, 1), @@ -1156,15 +1157,15 @@ public class greekStemmer extends AbstractSnowballStemmer { new Among("\u03C9\u03C4\u03B1\u03C4", -1, 1) }; - private static final char g_v[] = {81, 65, 16, 1}; + private static final char[] g_v = {81, 65, 16, 1}; - private static final char g_v2[] = {81, 65, 0, 1}; + private static final char[] g_v2 = {81, 65, 0, 1}; private boolean B_test1; private boolean r_has_min_length() { - return current.length() >= 3; + return length >= 3; } private boolean r_tolower() { @@ -1264,7 +1265,7 @@ private boolean r_tolower() { return true; } - private boolean r_step1() { + private boolean r_step_1() { int among_var; ket = cursor; among_var = find_among_b(a_1); @@ -1311,7 +1312,7 @@ private boolean r_step1() { return true; } - private boolean r_steps1() { + private boolean r_step_s1() { int among_var; ket = cursor; if (find_among_b(a_3) == 0) { @@ -1340,7 +1341,7 @@ private boolean r_steps1() { return true; } - private boolean r_steps2() { + private boolean r_step_s2() { ket = cursor; if (find_among_b(a_5) == 0) { return false; @@ -1360,23 +1361,18 @@ private boolean r_steps2() { return true; } - private boolean r_steps3() { + private boolean r_step_s3() { int among_var; - ket = cursor; - if (find_among_b(a_7) == 0) { - return false; - } - bra = cursor; - slice_del(); - B_test1 = false; lab0: { int v_1 = limit - cursor; lab1: { + ket = cursor; if (!(eq_s_b("\u03B9\u03C3\u03B1"))) { break lab1; } + bra = cursor; if (cursor > limit_backward) { break lab1; } @@ -1385,27 +1381,34 @@ private boolean r_steps3() { } cursor = limit - v_1; ket = cursor; - bra = cursor; - among_var = find_among_b(a_6); - if (among_var == 0) { - return false; - } - if (cursor > limit_backward) { - return false; - } - switch (among_var) { - case 1: - slice_from("\u03B9"); - break; - case 2: - slice_from("\u03B9\u03C3"); - break; - } + } + if (find_among_b(a_7) == 0) { + return false; + } + bra = cursor; + slice_del(); + B_test1 = false; + ket = cursor; + bra = cursor; + among_var = find_among_b(a_6); + if (among_var == 0) { + return false; + } + if (cursor > limit_backward) { + return false; + } + switch (among_var) { + case 1: + slice_from("\u03B9"); + break; + case 2: + slice_from("\u03B9\u03C3"); + break; } return true; } - private boolean r_steps4() { + private boolean r_step_s4() { ket = cursor; if (find_among_b(a_9) == 0) { return false; @@ -1425,7 +1428,7 @@ private boolean r_steps4() { return true; } - private boolean r_steps5() { + private boolean r_step_s5() { int among_var; ket = cursor; if (find_among_b(a_11) == 0) { @@ -1454,7 +1457,7 @@ private boolean r_steps5() { return true; } - private boolean r_steps6() { + private boolean r_step_s6() { int among_var; ket = cursor; if (find_among_b(a_14) == 0) { @@ -1530,7 +1533,7 @@ private boolean r_steps6() { return true; } - private boolean r_steps7() { + private boolean r_step_s7() { ket = cursor; if (find_among_b(a_16) == 0) { return false; @@ -1550,7 +1553,7 @@ private boolean r_steps7() { return true; } - private boolean r_steps8() { + private boolean r_step_s8() { int among_var; ket = cursor; if (find_among_b(a_18) == 0) { @@ -1594,7 +1597,7 @@ private boolean r_steps8() { return true; } - private boolean r_steps9() { + private boolean r_step_s9() { ket = cursor; if (find_among_b(a_21) == 0) { return false; @@ -1629,7 +1632,7 @@ private boolean r_steps9() { return true; } - private boolean r_steps10() { + private boolean r_step_s10() { ket = cursor; if (find_among_b(a_23) == 0) { return false; @@ -1649,7 +1652,7 @@ private boolean r_steps10() { return true; } - private boolean r_step2a() { + private boolean r_step_2a() { ket = cursor; if (find_among_b(a_24) == 0) { return false; @@ -1675,7 +1678,7 @@ private boolean r_step2a() { return true; } - private boolean r_step2b() { + private boolean r_step_2b() { ket = cursor; if (find_among_b(a_26) == 0) { return false; @@ -1691,7 +1694,7 @@ private boolean r_step2b() { return true; } - private boolean r_step2c() { + private boolean r_step_2c() { ket = cursor; if (find_among_b(a_28) == 0) { return false; @@ -1707,7 +1710,7 @@ private boolean r_step2c() { return true; } - private boolean r_step2d() { + private boolean r_step_2d() { ket = cursor; if (find_among_b(a_30) == 0) { return false; @@ -1727,7 +1730,7 @@ private boolean r_step2d() { return true; } - private boolean r_step3() { + private boolean r_step_3() { ket = cursor; if (find_among_b(a_32) == 0) { return false; @@ -1744,7 +1747,7 @@ private boolean r_step3() { return true; } - private boolean r_step4() { + private boolean r_step_4() { ket = cursor; if (find_among_b(a_33) == 0) { return false; @@ -1779,13 +1782,15 @@ private boolean r_step4() { return true; } - private boolean r_step5a() { + private boolean r_step_5a() { int v_1 = limit - cursor; lab0: { + ket = cursor; if (!(eq_s_b("\u03B1\u03B3\u03B1\u03BC\u03B5"))) { break lab0; } + bra = cursor; if (cursor > limit_backward) { break lab0; } @@ -1823,7 +1828,7 @@ private boolean r_step5a() { return true; } - private boolean r_step5b() { + private boolean r_step_5b() { int v_1 = limit - cursor; lab0: { @@ -1879,7 +1884,7 @@ private boolean r_step5b() { return true; } - private boolean r_step5c() { + private boolean r_step_5c() { int v_1 = limit - cursor; lab0: { @@ -1937,7 +1942,7 @@ private boolean r_step5c() { return true; } - private boolean r_step5d() { + private boolean r_step_5d() { ket = cursor; if (find_among_b(a_43) == 0) { return false; @@ -1972,7 +1977,7 @@ private boolean r_step5d() { return true; } - private boolean r_step5e() { + private boolean r_step_5e() { ket = cursor; if (find_among_b(a_44) == 0) { return false; @@ -1992,7 +1997,7 @@ private boolean r_step5e() { return true; } - private boolean r_step5f() { + private boolean r_step_5f() { int v_1 = limit - cursor; lab0: { @@ -2033,7 +2038,7 @@ private boolean r_step5f() { return true; } - private boolean r_step5g() { + private boolean r_step_5g() { int v_1 = limit - cursor; lab0: { @@ -2080,7 +2085,7 @@ private boolean r_step5g() { return true; } - private boolean r_step5h() { + private boolean r_step_5h() { ket = cursor; if (find_among_b(a_53) == 0) { return false; @@ -2115,7 +2120,7 @@ private boolean r_step5h() { return true; } - private boolean r_step5i() { + private boolean r_step_5i() { int among_var; ket = cursor; if (find_among_b(a_56) == 0) { @@ -2171,7 +2176,7 @@ private boolean r_step5i() { return true; } - private boolean r_step5j() { + private boolean r_step_5j() { ket = cursor; if (find_among_b(a_57) == 0) { return false; @@ -2191,7 +2196,7 @@ private boolean r_step5j() { return true; } - private boolean r_step5k() { + private boolean r_step_5k() { ket = cursor; if (find_among_b(a_59) == 0) { return false; @@ -2211,7 +2216,7 @@ private boolean r_step5k() { return true; } - private boolean r_step5l() { + private boolean r_step_5l() { ket = cursor; if (find_among_b(a_61) == 0) { return false; @@ -2231,7 +2236,7 @@ private boolean r_step5l() { return true; } - private boolean r_step5m() { + private boolean r_step_5m() { ket = cursor; if (find_among_b(a_63) == 0) { return false; @@ -2251,7 +2256,7 @@ private boolean r_step5m() { return true; } - private boolean r_step6() { + private boolean r_step_6() { int v_1 = limit - cursor; lab0: { @@ -2275,7 +2280,7 @@ private boolean r_step6() { return true; } - private boolean r_step7() { + private boolean r_step_7() { ket = cursor; if (find_among_b(a_67) == 0) { return false; @@ -2285,6 +2290,7 @@ private boolean r_step7() { return true; } + @Override public boolean stem() { limit_backward = cursor; cursor = limit; @@ -2296,100 +2302,100 @@ public boolean stem() { } B_test1 = true; int v_2 = limit - cursor; - r_step1(); + r_step_1(); cursor = limit - v_2; int v_3 = limit - cursor; - r_steps1(); + r_step_s1(); cursor = limit - v_3; int v_4 = limit - cursor; - r_steps2(); + r_step_s2(); cursor = limit - v_4; int v_5 = limit - cursor; - r_steps3(); + r_step_s3(); cursor = limit - v_5; int v_6 = limit - cursor; - r_steps4(); + r_step_s4(); cursor = limit - v_6; int v_7 = limit - cursor; - r_steps5(); + r_step_s5(); cursor = limit - v_7; int v_8 = limit - cursor; - r_steps6(); + r_step_s6(); cursor = limit - v_8; int v_9 = limit - cursor; - r_steps7(); + r_step_s7(); cursor = limit - v_9; int v_10 = limit - cursor; - r_steps8(); + r_step_s8(); cursor = limit - v_10; int v_11 = limit - cursor; - r_steps9(); + r_step_s9(); cursor = limit - v_11; int v_12 = limit - cursor; - r_steps10(); + r_step_s10(); cursor = limit - v_12; int v_13 = limit - cursor; - r_step2a(); + r_step_2a(); cursor = limit - v_13; int v_14 = limit - cursor; - r_step2b(); + r_step_2b(); cursor = limit - v_14; int v_15 = limit - cursor; - r_step2c(); + r_step_2c(); cursor = limit - v_15; int v_16 = limit - cursor; - r_step2d(); + r_step_2d(); cursor = limit - v_16; int v_17 = limit - cursor; - r_step3(); + r_step_3(); cursor = limit - v_17; int v_18 = limit - cursor; - r_step4(); + r_step_4(); cursor = limit - v_18; int v_19 = limit - cursor; - r_step5a(); + r_step_5a(); cursor = limit - v_19; int v_20 = limit - cursor; - r_step5b(); + r_step_5b(); cursor = limit - v_20; int v_21 = limit - cursor; - r_step5c(); + r_step_5c(); cursor = limit - v_21; int v_22 = limit - cursor; - r_step5d(); + r_step_5d(); cursor = limit - v_22; int v_23 = limit - cursor; - r_step5e(); + r_step_5e(); cursor = limit - v_23; int v_24 = limit - cursor; - r_step5f(); + r_step_5f(); cursor = limit - v_24; int v_25 = limit - cursor; - r_step5g(); + r_step_5g(); cursor = limit - v_25; int v_26 = limit - cursor; - r_step5h(); + r_step_5h(); cursor = limit - v_26; int v_27 = limit - cursor; - r_step5j(); + r_step_5j(); cursor = limit - v_27; int v_28 = limit - cursor; - r_step5i(); + r_step_5i(); cursor = limit - v_28; int v_29 = limit - cursor; - r_step5k(); + r_step_5k(); cursor = limit - v_29; int v_30 = limit - cursor; - r_step5l(); + r_step_5l(); cursor = limit - v_30; int v_31 = limit - cursor; - r_step5m(); + r_step_5m(); cursor = limit - v_31; int v_32 = limit - cursor; - r_step6(); + r_step_6(); cursor = limit - v_32; int v_33 = limit - cursor; - r_step7(); + r_step_7(); cursor = limit - v_33; cursor = limit_backward; return true; diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/hungarianStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/hungarianStemmer.java index eeffee70a..6d5e0b0c3 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/hungarianStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/hungarianStemmer.java @@ -30,21 +30,21 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; - /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class hungarianStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("cs", -1, -1), new Among("dzs", -1, -1), new Among("gy", -1, -1), @@ -55,12 +55,12 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("zs", -1, -1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("bb", -1, -1), new Among("cc", -1, -1), new Among("dd", -1, -1), @@ -86,12 +86,12 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("zz", -1, -1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("al", -1, 1), new Among("el", -1, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("ba", -1, -1), new Among("ra", -1, -1), new Among("be", -1, -1), @@ -138,13 +138,13 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("v\u00E9", -1, -1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("\u00E1n", -1, 2), new Among("\u00E9n", -1, 1), new Among("\u00E1nk\u00E9nt", -1, 2) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("stul", -1, 1), new Among("astul", 0, 1), new Among("\u00E1stul", 0, 2), @@ -153,12 +153,12 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("\u00E9st\u00FCl", 3, 3) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 1) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("k", -1, 3), new Among("ak", 0, 3), new Among("ek", 0, 3), @@ -168,7 +168,7 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("\u00F6k", 0, 3) }; - private final static Among a_9[] = { + private final static Among[] a_9 = { new Among("\u00E9i", -1, 1), new Among("\u00E1\u00E9i", 0, 3), new Among("\u00E9\u00E9i", 0, 2), @@ -183,7 +183,7 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("\u00E9\u00E9", 3, 2) }; - private final static Among a_10[] = { + private final static Among[] a_10 = { new Among("a", -1, 1), new Among("ja", 0, 1), new Among("d", -1, 1), @@ -217,7 +217,7 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("\u00E9", -1, 3) }; - private final static Among a_11[] = { + private final static Among[] a_11 = { new Among("id", -1, 1), new Among("aid", 0, 1), new Among("jaid", 1, 1), @@ -262,7 +262,7 @@ public class hungarianStemmer extends AbstractSnowballStemmer { new Among("\u00E9im", 35, 3) }; - private static final char g_v[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 36, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1}; + private static final char[] g_v = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 36, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1}; private int I_p1; @@ -590,6 +590,7 @@ private boolean r_plur_owner() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_mark_regions(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/indonesianStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/indonesianStemmer.java index 009a52cf4..cff4ba555 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/indonesianStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/indonesianStemmer.java @@ -1,8 +1,8 @@ // CHECKSTYLE:OFF /* -Copyright (c) 2010, Israel Olalla -Copyright (c) 2010, ISOCO +Copyright (c) 2001, Dr Martin Porter +Copyright (c) 2002, Richard Boulton All rights reserved. Redistribution and use in source and binary forms, with or without @@ -30,55 +30,57 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class indonesianStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; + private static final java.lang.invoke.MethodHandles.Lookup methodObject = java.lang.invoke.MethodHandles.lookup(); - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("kah", -1, 1), new Among("lah", -1, 1), new Among("pun", -1, 1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("nya", -1, 1), new Among("ku", -1, 1), new Among("mu", -1, 1) }; - private final static Among a_2[] = { - new Among("i", -1, 1, "r_SUFFIX_I_OK", indonesianStemmer.class), - new Among("an", -1, 1, "r_SUFFIX_AN_OK", indonesianStemmer.class), - new Among("kan", 1, 1, "r_SUFFIX_KAN_OK", indonesianStemmer.class) + private final static Among[] a_2 = { + new Among("i", -1, 1, "r_SUFFIX_I_OK", methodObject), + new Among("an", -1, 1, "r_SUFFIX_AN_OK", methodObject), + new Among("kan", 1, 1, "r_SUFFIX_KAN_OK", methodObject) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("di", -1, 1), new Among("ke", -1, 2), new Among("me", -1, 1), new Among("mem", 2, 5), new Among("men", 2, 1), new Among("meng", 4, 1), - new Among("meny", 4, 3, "r_VOWEL", indonesianStemmer.class), + new Among("meny", 4, 3, "r_VOWEL", methodObject), new Among("pem", -1, 6), new Among("pen", -1, 2), new Among("peng", 8, 2), - new Among("peny", 8, 4, "r_VOWEL", indonesianStemmer.class), + new Among("peny", 8, 4, "r_VOWEL", methodObject), new Among("ter", -1, 1) }; - private final static Among a_4[] = { - new Among("be", -1, 3, "r_KER", indonesianStemmer.class), + private final static Among[] a_4 = { + new Among("be", -1, 3, "r_KER", methodObject), new Among("belajar", 0, 4), new Among("ber", 0, 3), new Among("pe", -1, 1), @@ -86,7 +88,7 @@ public class indonesianStemmer extends AbstractSnowballStemmer { new Among("per", 3, 1) }; - private static final char g_vowel[] = {17, 65, 16}; + private static final char[] g_vowel = {17, 65, 16}; private int I_prefix; private int I_measure; @@ -114,7 +116,7 @@ private boolean r_remove_possessive_pronoun() { return true; } - public boolean r_SUFFIX_KAN_OK() { + private boolean r_SUFFIX_KAN_OK() { if (I_prefix == 3) { return false; } @@ -124,11 +126,11 @@ public boolean r_SUFFIX_KAN_OK() { return true; } - public boolean r_SUFFIX_AN_OK() { + private boolean r_SUFFIX_AN_OK() { return I_prefix != 1; } - public boolean r_SUFFIX_I_OK() { + private boolean r_SUFFIX_I_OK() { if (I_prefix > 2) { return false; } @@ -157,14 +159,14 @@ private boolean r_remove_suffix() { return true; } - public boolean r_VOWEL() { + private boolean r_VOWEL() { if (!(in_grouping(g_vowel, 97, 117))) { return false; } return true; } - public boolean r_KER() { + private boolean r_KER() { if (!(out_grouping(g_vowel, 97, 117))) { return false; } @@ -279,6 +281,7 @@ private boolean r_remove_second_order_prefix() { return true; } + @Override public boolean stem() { I_measure = 0; int v_1 = cursor; diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/irishStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/irishStemmer.java index b91648b23..67e76f261 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/irishStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/irishStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class irishStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("b'", -1, 1), new Among("bh", -1, 4), new Among("bhf", 1, 2), @@ -71,7 +72,7 @@ public class irishStemmer extends AbstractSnowballStemmer { new Among("ts", -1, 3) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("\u00EDochta", -1, 1), new Among("a\u00EDochta", 0, 1), new Among("ire", -1, 2), @@ -90,7 +91,7 @@ public class irishStemmer extends AbstractSnowballStemmer { new Among("air\u00ED", 14, 2) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("\u00F3ideacha", -1, 6), new Among("patacha", -1, 5), new Among("achta", -1, 1), @@ -118,7 +119,7 @@ public class irishStemmer extends AbstractSnowballStemmer { new Among("grafa\u00EDochta\u00ED", -1, 4) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("imid", -1, 1), new Among("aimid", 0, 1), new Among("\u00EDmid", -1, 1), @@ -133,7 +134,7 @@ public class irishStemmer extends AbstractSnowballStemmer { new Among("tar", -1, 2) }; - private static final char g_v[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 2}; + private static final char[] g_v = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 2}; private int I_p2; private int I_p1; @@ -350,6 +351,7 @@ private boolean r_verb_sfx() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_initial_morph(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/italianStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/italianStemmer.java index e07a86437..1ea186b80 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/italianStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/italianStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class italianStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("", -1, 7), new Among("qu", 0, 6), new Among("\u00E1", 0, 1), @@ -54,13 +55,13 @@ public class italianStemmer extends AbstractSnowballStemmer { new Among("\u00FA", 0, 5) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("", -1, 3), new Among("I", 0, 1), new Among("U", 0, 2) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("la", -1, -1), new Among("cela", 0, -1), new Among("gliela", 0, -1), @@ -100,7 +101,7 @@ public class italianStemmer extends AbstractSnowballStemmer { new Among("velo", 31, -1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("ando", -1, 1), new Among("endo", -1, 1), new Among("ar", -1, 2), @@ -108,20 +109,20 @@ public class italianStemmer extends AbstractSnowballStemmer { new Among("ir", -1, 2) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("ic", -1, -1), new Among("abil", -1, -1), new Among("os", -1, -1), new Among("iv", -1, 1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("ic", -1, 1), new Among("abil", -1, 1), new Among("iv", -1, 1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("ica", -1, 1), new Among("logia", -1, 3), new Among("osa", -1, 1), @@ -175,7 +176,7 @@ public class italianStemmer extends AbstractSnowballStemmer { new Among("ist\u00EC", -1, 1) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("isca", -1, 1), new Among("enda", -1, 1), new Among("ata", -1, 1), @@ -265,11 +266,11 @@ public class italianStemmer extends AbstractSnowballStemmer { new Among("ir\u00F2", -1, 1) }; - private static final char g_v[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1}; + private static final char[] g_v = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1}; - private static final char g_AEIO[] = {17, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2}; + private static final char[] g_AEIO = {17, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2}; - private static final char g_CG[] = {17}; + private static final char[] g_CG = {17}; private int I_p2; private int I_p1; @@ -841,6 +842,7 @@ private boolean r_exceptions() { return true; } + @Override public boolean stem() { lab0: { diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/norwegianStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/norwegianStemmer.java index 026bcb611..909b05725 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/norwegianStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/norwegianStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class norwegianStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("a", -1, 1), new Among("e", -1, 1), new Among("ede", 1, 1), @@ -76,12 +77,12 @@ public class norwegianStemmer extends AbstractSnowballStemmer { new Among("ast", -1, 1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("dt", -1, -1), new Among("vt", -1, -1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("leg", -1, 1), new Among("eleg", 0, 1), new Among("ig", -1, 1), @@ -95,9 +96,9 @@ public class norwegianStemmer extends AbstractSnowballStemmer { new Among("hetslov", 9, 1) }; - private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128}; + private static final char[] g_v = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128}; - private static final char g_s_ending[] = {119, 125, 149, 1}; + private static final char[] g_s_ending = {119, 125, 149, 1}; private int I_x; private int I_p1; @@ -245,6 +246,7 @@ private boolean r_other_suffix() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_mark_regions(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/porterStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/porterStemmer.java index c0fad2d72..86d93d3c0 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/porterStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/porterStemmer.java @@ -30,28 +30,29 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class porterStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("s", -1, 3), new Among("ies", 0, 2), new Among("sses", 0, 1), new Among("ss", 0, -1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("", -1, 3), new Among("bb", 0, 2), new Among("dd", 0, 2), @@ -67,13 +68,13 @@ public class porterStemmer extends AbstractSnowballStemmer { new Among("iz", 0, 1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ed", -1, 2), new Among("eed", 0, 1), new Among("ing", -1, 2) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("anci", -1, 3), new Among("enci", -1, 2), new Among("abli", -1, 4), @@ -96,7 +97,7 @@ public class porterStemmer extends AbstractSnowballStemmer { new Among("ousness", -1, 11) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("icate", -1, 2), new Among("ative", -1, 3), new Among("alize", -1, 1), @@ -106,7 +107,7 @@ public class porterStemmer extends AbstractSnowballStemmer { new Among("ness", -1, 3) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("ic", -1, 1), new Among("ance", -1, 1), new Among("ence", -1, 1), @@ -128,9 +129,9 @@ public class porterStemmer extends AbstractSnowballStemmer { new Among("ou", -1, 1) }; - private static final char g_v[] = {17, 65, 16, 1}; + private static final char[] g_v = {17, 65, 16, 1}; - private static final char g_v_WXY[] = {1, 17, 65, 208, 1}; + private static final char[] g_v_WXY = {1, 17, 65, 208, 1}; private boolean B_Y_found; private int I_p2; @@ -414,7 +415,6 @@ private boolean r_Step_5a() { bra = cursor; lab0: { - int v_1 = limit - cursor; lab1: { if (!r_R2()) { @@ -422,7 +422,6 @@ private boolean r_Step_5a() { } break lab0; } - cursor = limit - v_1; if (!r_R1()) { return false; } @@ -458,6 +457,7 @@ private boolean r_Step_5b() { return true; } + @Override public boolean stem() { B_Y_found = false; int v_1 = cursor; diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/portugueseStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/portugueseStemmer.java index e666f3c72..80370b68e 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/portugueseStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/portugueseStemmer.java @@ -30,52 +30,53 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class portugueseStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("", -1, 3), new Among("\u00E3", 0, 1), new Among("\u00F5", 0, 2) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("", -1, 3), new Among("a~", 0, 1), new Among("o~", 0, 2) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ic", -1, -1), new Among("ad", -1, -1), new Among("os", -1, -1), new Among("iv", -1, 1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("ante", -1, 1), new Among("avel", -1, 1), new Among("\u00EDvel", -1, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("ic", -1, 1), new Among("abil", -1, 1), new Among("iv", -1, 1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("ica", -1, 1), new Among("\u00E2ncia", -1, 1), new Among("\u00EAncia", -1, 4), @@ -123,7 +124,7 @@ public class portugueseStemmer extends AbstractSnowballStemmer { new Among("ivos", -1, 8) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("ada", -1, 1), new Among("ida", -1, 1), new Among("ia", -1, 1), @@ -246,7 +247,7 @@ public class portugueseStemmer extends AbstractSnowballStemmer { new Among("ir\u00E1", -1, 1) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("a", -1, 1), new Among("i", -1, 1), new Among("o", -1, 1), @@ -256,14 +257,14 @@ public class portugueseStemmer extends AbstractSnowballStemmer { new Among("\u00F3", -1, 1) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("e", -1, 1), new Among("\u00E7", -1, 2), new Among("\u00E9", -1, 1), new Among("\u00EA", -1, 1) }; - private static final char g_v[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 12, 2}; + private static final char[] g_v = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 12, 2}; private int I_p2; private int I_p1; @@ -741,6 +742,7 @@ private boolean r_residual_form() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_prelude(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/romanianStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/romanianStemmer.java index e1adfcc72..cd2a78dfb 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/romanianStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/romanianStemmer.java @@ -30,32 +30,33 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class romanianStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("\u015F", -1, 1), new Among("\u0163", -1, 2) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("", -1, 3), new Among("I", 0, 1), new Among("U", 0, 2) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ea", -1, 3), new Among("a\u021Bia", -1, 7), new Among("aua", -1, 2), @@ -74,7 +75,7 @@ public class romanianStemmer extends AbstractSnowballStemmer { new Among("iilor", 14, 4) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("icala", -1, 4), new Among("iciva", -1, 4), new Among("ativa", -1, 5), @@ -123,7 +124,7 @@ public class romanianStemmer extends AbstractSnowballStemmer { new Among("itiv\u0103", -1, 6) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("ica", -1, 1), new Among("abila", -1, 1), new Among("ibila", -1, 1), @@ -188,7 +189,7 @@ public class romanianStemmer extends AbstractSnowballStemmer { new Among("iv\u0103", -1, 1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("ea", -1, 1), new Among("ia", -1, 1), new Among("esc", -1, 1), @@ -285,7 +286,7 @@ public class romanianStemmer extends AbstractSnowballStemmer { new Among("eaz\u0103", -1, 1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("a", -1, 1), new Among("e", -1, 1), new Among("ie", 1, 1), @@ -293,7 +294,7 @@ public class romanianStemmer extends AbstractSnowballStemmer { new Among("\u0103", -1, 1) }; - private static final char g_v[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4}; + private static final char[] g_v = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4}; private boolean B_standard_suffix_removed; private int I_p2; @@ -796,6 +797,7 @@ private boolean r_vowel_suffix() { return true; } + @Override public boolean stem() { r_norm(); int v_2 = cursor; diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/russianStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/russianStemmer.java index 4050b6e3d..fa87eb582 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/russianStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/russianStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class russianStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("\u0432", -1, 1), new Among("\u0438\u0432", 0, 2), new Among("\u044B\u0432", 0, 2), @@ -56,7 +57,7 @@ public class russianStemmer extends AbstractSnowballStemmer { new Among("\u044B\u0432\u0448\u0438\u0441\u044C", 6, 2) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("\u0435\u0435", -1, 1), new Among("\u0438\u0435", -1, 1), new Among("\u043E\u0435", -1, 1), @@ -85,7 +86,7 @@ public class russianStemmer extends AbstractSnowballStemmer { new Among("\u044F\u044F", -1, 1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("\u0435\u043C", -1, 1), new Among("\u043D\u043D", -1, 1), new Among("\u0432\u0448", -1, 1), @@ -96,12 +97,12 @@ public class russianStemmer extends AbstractSnowballStemmer { new Among("\u0443\u044E\u0449", 6, 2) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("\u0441\u044C", -1, 1), new Among("\u0441\u044F", -1, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("\u043B\u0430", -1, 1), new Among("\u0438\u043B\u0430", 0, 2), new Among("\u044B\u043B\u0430", 0, 2), @@ -150,7 +151,7 @@ public class russianStemmer extends AbstractSnowballStemmer { new Among("\u0443\u044E", 44, 2) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("\u0430", -1, 1), new Among("\u0435\u0432", -1, 1), new Among("\u043E\u0432", -1, 1), @@ -189,19 +190,19 @@ public class russianStemmer extends AbstractSnowballStemmer { new Among("\u044C\u044F", 33, 1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("\u043E\u0441\u0442", -1, 1), new Among("\u043E\u0441\u0442\u044C", -1, 1) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("\u0435\u0439\u0448\u0435", -1, 1), new Among("\u043D", -1, 2), new Among("\u0435\u0439\u0448", -1, 1), new Among("\u044C", -1, 3) }; - private static final char g_v[] = {33, 65, 8, 232}; + private static final char[] g_v = {33, 65, 8, 232}; private int I_p2; private int I_pV; @@ -468,6 +469,7 @@ private boolean r_tidy_up() { return true; } + @Override public boolean stem() { int v_1 = cursor; lab0: diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/spanishStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/spanishStemmer.java index 660e039f7..e0a9a76a9 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/spanishStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/spanishStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class spanishStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("", -1, 6), new Among("\u00E1", 0, 1), new Among("\u00E9", 0, 2), @@ -53,7 +54,7 @@ public class spanishStemmer extends AbstractSnowballStemmer { new Among("\u00FA", 0, 5) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("la", -1, -1), new Among("sela", 0, -1), new Among("le", -1, -1), @@ -69,7 +70,7 @@ public class spanishStemmer extends AbstractSnowballStemmer { new Among("nos", -1, -1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ando", -1, 6), new Among("iendo", -1, 6), new Among("yendo", -1, 7), @@ -83,26 +84,26 @@ public class spanishStemmer extends AbstractSnowballStemmer { new Among("\u00EDr", -1, 5) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("ic", -1, -1), new Among("ad", -1, -1), new Among("os", -1, -1), new Among("iv", -1, 1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("able", -1, 1), new Among("ible", -1, 1), new Among("ante", -1, 1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("ic", -1, 1), new Among("abil", -1, 1), new Among("iv", -1, 1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("ica", -1, 1), new Among("ancia", -1, 2), new Among("encia", -1, 5), @@ -151,7 +152,7 @@ public class spanishStemmer extends AbstractSnowballStemmer { new Among("ivos", -1, 9) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("ya", -1, 1), new Among("ye", -1, 1), new Among("yan", -1, 1), @@ -166,7 +167,7 @@ public class spanishStemmer extends AbstractSnowballStemmer { new Among("y\u00F3", -1, 1) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("aba", -1, 2), new Among("ada", -1, 2), new Among("ida", -1, 2), @@ -265,7 +266,7 @@ public class spanishStemmer extends AbstractSnowballStemmer { new Among("i\u00F3", -1, 2) }; - private final static Among a_9[] = { + private final static Among[] a_9 = { new Among("a", -1, 1), new Among("e", -1, 2), new Among("o", -1, 1), @@ -276,7 +277,7 @@ public class spanishStemmer extends AbstractSnowballStemmer { new Among("\u00F3", -1, 1) }; - private static final char g_v[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10}; + private static final char[] g_v = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10}; private int I_p2; private int I_p1; @@ -815,6 +816,7 @@ private boolean r_residual_suffix() { return true; } + @Override public boolean stem() { r_mark_regions(); limit_backward = cursor; diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/swedishStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/swedishStemmer.java index 8c449de06..1be5c6e96 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/swedishStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/swedishStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class swedishStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("a", -1, 1), new Among("arna", 0, 1), new Among("erna", 0, 1), @@ -84,7 +85,7 @@ public class swedishStemmer extends AbstractSnowballStemmer { new Among("ast", -1, 1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("dd", -1, -1), new Among("gd", -1, -1), new Among("nn", -1, -1), @@ -94,7 +95,7 @@ public class swedishStemmer extends AbstractSnowballStemmer { new Among("tt", -1, -1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ig", -1, 1), new Among("lig", 0, 1), new Among("els", -1, 1), @@ -102,11 +103,11 @@ public class swedishStemmer extends AbstractSnowballStemmer { new Among("\u00F6st", -1, 2) }; - private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32}; + private static final char[] g_v = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32}; - private static final char g_s_ending[] = {119, 127, 149}; + private static final char[] g_s_ending = {119, 127, 149}; - private static final char g_ost_ending[] = {173, 58}; + private static final char[] g_ost_ending = {173, 58}; private int I_x; private int I_p1; @@ -251,6 +252,7 @@ private boolean r_other_suffix() { return true; } + @Override public boolean stem() { int v_1 = cursor; r_mark_regions(); diff --git a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/turkishStemmer.java b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/turkishStemmer.java index 4076ecad4..96c671763 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/turkishStemmer.java +++ b/opennlp-tools/src/main/java/opennlp/tools/stemmer/snowball/turkishStemmer.java @@ -30,21 +30,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) +// Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) package opennlp.tools.stemmer.snowball; /** * This class implements the stemming algorithm defined by a snowball script. *- * Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9) - https://github.com/snowballstem/snowball + * Generated by Snowball (build from 9a22f0d3f44cda36677829328fe2642750114d57) - https://github.com/snowballstem/snowball *
*/ @SuppressWarnings("unused") public class turkishStemmer extends AbstractSnowballStemmer { + private static final long serialVersionUID = 1L; - private final static Among a_0[] = { + private final static Among[] a_0 = { new Among("m", -1, -1), new Among("n", -1, -1), new Among("miz", -1, -1), @@ -57,110 +58,110 @@ public class turkishStemmer extends AbstractSnowballStemmer { new Among("n\u0131z", -1, -1) }; - private final static Among a_1[] = { + private final static Among[] a_1 = { new Among("leri", -1, -1), new Among("lar\u0131", -1, -1) }; - private final static Among a_2[] = { + private final static Among[] a_2 = { new Among("ni", -1, -1), new Among("nu", -1, -1), new Among("n\u00FC", -1, -1), new Among("n\u0131", -1, -1) }; - private final static Among a_3[] = { + private final static Among[] a_3 = { new Among("in", -1, -1), new Among("un", -1, -1), new Among("\u00FCn", -1, -1), new Among("\u0131n", -1, -1) }; - private final static Among a_4[] = { + private final static Among[] a_4 = { new Among("a", -1, -1), new Among("e", -1, -1) }; - private final static Among a_5[] = { + private final static Among[] a_5 = { new Among("na", -1, -1), new Among("ne", -1, -1) }; - private final static Among a_6[] = { + private final static Among[] a_6 = { new Among("da", -1, -1), new Among("ta", -1, -1), new Among("de", -1, -1), new Among("te", -1, -1) }; - private final static Among a_7[] = { + private final static Among[] a_7 = { new Among("nda", -1, -1), new Among("nde", -1, -1) }; - private final static Among a_8[] = { + private final static Among[] a_8 = { new Among("dan", -1, -1), new Among("tan", -1, -1), new Among("den", -1, -1), new Among("ten", -1, -1) }; - private final static Among a_9[] = { + private final static Among[] a_9 = { new Among("ndan", -1, -1), new Among("nden", -1, -1) }; - private final static Among a_10[] = { + private final static Among[] a_10 = { new Among("la", -1, -1), new Among("le", -1, -1) }; - private final static Among a_11[] = { + private final static Among[] a_11 = { new Among("ca", -1, -1), new Among("ce", -1, -1) }; - private final static Among a_12[] = { + private final static Among[] a_12 = { new Among("im", -1, -1), new Among("um", -1, -1), new Among("\u00FCm", -1, -1), new Among("\u0131m", -1, -1) }; - private final static Among a_13[] = { + private final static Among[] a_13 = { new Among("sin", -1, -1), new Among("sun", -1, -1), new Among("s\u00FCn", -1, -1), new Among("s\u0131n", -1, -1) }; - private final static Among a_14[] = { + private final static Among[] a_14 = { new Among("iz", -1, -1), new Among("uz", -1, -1), new Among("\u00FCz", -1, -1), new Among("\u0131z", -1, -1) }; - private final static Among a_15[] = { + private final static Among[] a_15 = { new Among("siniz", -1, -1), new Among("sunuz", -1, -1), new Among("s\u00FCn\u00FCz", -1, -1), new Among("s\u0131n\u0131z", -1, -1) }; - private final static Among a_16[] = { + private final static Among[] a_16 = { new Among("lar", -1, -1), new Among("ler", -1, -1) }; - private final static Among a_17[] = { + private final static Among[] a_17 = { new Among("niz", -1, -1), new Among("nuz", -1, -1), new Among("n\u00FCz", -1, -1), new Among("n\u0131z", -1, -1) }; - private final static Among a_18[] = { + private final static Among[] a_18 = { new Among("dir", -1, -1), new Among("tir", -1, -1), new Among("dur", -1, -1), @@ -171,12 +172,12 @@ public class turkishStemmer extends AbstractSnowballStemmer { new Among("t\u0131r", -1, -1) }; - private final static Among a_19[] = { + private final static Among[] a_19 = { new Among("cas\u0131na", -1, -1), new Among("cesine", -1, -1) }; - private final static Among a_20[] = { + private final static Among[] a_20 = { new Among("di", -1, -1), new Among("ti", -1, -1), new Among("dik", -1, -1), @@ -211,7 +212,7 @@ public class turkishStemmer extends AbstractSnowballStemmer { new Among("t\u0131", -1, -1) }; - private final static Among a_21[] = { + private final static Among[] a_21 = { new Among("sa", -1, -1), new Among("se", -1, -1), new Among("sak", -1, -1), @@ -222,35 +223,35 @@ public class turkishStemmer extends AbstractSnowballStemmer { new Among("sen", -1, -1) }; - private final static Among a_22[] = { + private final static Among[] a_22 = { new Among("mi\u015F", -1, -1), new Among("mu\u015F", -1, -1), new Among("m\u00FC\u015F", -1, -1), new Among("m\u0131\u015F", -1, -1) }; - private final static Among a_23[] = { + private final static Among[] a_23 = { new Among("b", -1, 1), new Among("c", -1, 2), new Among("d", -1, 3), new Among("\u011F", -1, 4) }; - private static final char g_vowel[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 0, 0, 0, 0, 0, 0, 1}; + private static final char[] g_vowel = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 0, 0, 0, 0, 0, 0, 1}; - private static final char g_U[] = {1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1}; + private static final char[] g_U = {1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1}; - private static final char g_vowel1[] = {1, 64, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + private static final char[] g_vowel1 = {1, 64, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; - private static final char g_vowel2[] = {17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130}; + private static final char[] g_vowel2 = {17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130}; - private static final char g_vowel3[] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + private static final char[] g_vowel3 = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; - private static final char g_vowel4[] = {17}; + private static final char[] g_vowel4 = {17}; - private static final char g_vowel5[] = {65}; + private static final char[] g_vowel5 = {65}; - private static final char g_vowel6[] = {65}; + private static final char[] g_vowel6 = {65}; private boolean B_continue_stemming_noun_suffixes; @@ -2064,6 +2065,36 @@ private boolean r_is_reserved_word() { return true; } + private boolean r_remove_proper_noun_suffix() { + int v_1 = cursor; + lab0: + { + golab1: + while (true) { + int v_2 = cursor; + lab2: + { + if (!(eq_s("'"))) { + break lab2; + } + cursor = v_2; + break golab1; + } + cursor = v_2; + if (cursor >= limit) { + break lab0; + } + cursor++; + } + bra = cursor; + cursor = limit; + ket = cursor; + slice_del(); + } + cursor = v_1; + return true; + } + private boolean r_more_than_one_syllable_word() { int v_1 = cursor; for (int v_2 = 2; v_2 > 0; v_2--) { @@ -2110,21 +2141,23 @@ private boolean r_postlude() { return true; } + @Override public boolean stem() { + r_remove_proper_noun_suffix(); if (!r_more_than_one_syllable_word()) { return false; } limit_backward = cursor; cursor = limit; - int v_1 = limit - cursor; + int v_2 = limit - cursor; r_stem_nominal_verb_suffixes(); - cursor = limit - v_1; + cursor = limit - v_2; if (!(B_continue_stemming_noun_suffixes)) { return false; } - int v_2 = limit - cursor; + int v_3 = limit - cursor; r_stem_noun_suffixes(); - cursor = limit - v_2; + cursor = limit - v_3; cursor = limit_backward; if (!r_postlude()) { return false;