Skip to content

Commit

Permalink
OPENNLP-1520 - Re-Generate Snowball Stemmer Java Code.
Browse files Browse the repository at this point in the history
Adds a test case for Finish Stemmer
  • Loading branch information
rzo1 committed Dec 7, 2023
1 parent 617d08f commit 64891fa
Show file tree
Hide file tree
Showing 25 changed files with 14,788 additions and 23,084 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,31 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
*/

// Generated by Snowball (build from 867c4ec70debd4daa7fb4d5a9f7759b47887d0b9)
package opennlp.tools.stemmer.snowball;

import java.lang.reflect.Method;

class Among {
public Among (String s, int substring_i, int result,
String methodname, SnowballProgram methodobject) {
this.s_size = s.length();
this.s = s.toCharArray();
this.substring_i = substring_i;
this.result = result;
this.methodobject = methodobject;
if (methodname.length() == 0) {
this.method = null;
} else {
try {
this.method = methodobject.getClass().
getDeclaredMethod(methodname, new Class[0]);
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
}
}

public final int s_size; /* search string */
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 final SnowballProgram methodobject; /* object to invoke method on */
public Among(String s, int substring_i, int result) {
this.s = s.toCharArray();
this.substring_i = substring_i;
this.result = result;
this.method = null;
}
public Among(String s, int substring_i, int result, String methodname,
Class<? extends AbstractSnowballStemmer> programclass) {
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);
}
}
}
Loading

0 comments on commit 64891fa

Please sign in to comment.