org.apache.lucene.snowball_2.9.1.v20100421-0704

16:41:14.059 INFO  jd.cli.Main - Decompiling org.apache.lucene.snowball_2.9.1.v20100421-0704.jar
package org.apache.lucene.analysis.snowball;

class SnowballAnalyzer$1 {}

/* Location:
 * Qualified Name:     org.apache.lucene.analysis.snowball.SnowballAnalyzer.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.analysis.snowball;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;

class SnowballAnalyzer$SavedStreams
{
  Tokenizer source;
  TokenStream result;
  private final SnowballAnalyzer this$0;
  
  private SnowballAnalyzer$SavedStreams(SnowballAnalyzer paramSnowballAnalyzer) {}
  
  SnowballAnalyzer$SavedStreams(SnowballAnalyzer x0, SnowballAnalyzer.1 x1)
  {
    this(x0);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.analysis.snowball.SnowballAnalyzer.SavedStreams
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.analysis.snowball;

import java.io.IOException;
import java.io.Reader;
import java.util.Set;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.LowerCaseFilter;
import org.apache.lucene.analysis.StopFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.standard.StandardFilter;
import org.apache.lucene.analysis.standard.StandardTokenizer;
import org.apache.lucene.util.Version;

public class SnowballAnalyzer
  extends Analyzer
{
  private String name;
  private Set stopSet;
  private final Version matchVersion;
  
  /**
   * @deprecated
   */
  public SnowballAnalyzer(String name)
  {
    this(Version.LUCENE_23, name);
  }
  
  public SnowballAnalyzer(Version matchVersion, String name)
  {
    this.name = name;
    setOverridesTokenStreamMethod(SnowballAnalyzer.class);
    this.matchVersion = matchVersion;
  }
  
  /**
   * @deprecated
   */
  public SnowballAnalyzer(String name, String[] stopWords)
  {
    this(Version.LUCENE_23, name, stopWords);
  }
  
  public SnowballAnalyzer(Version matchVersion, String name, String[] stopWords)
  {
    this(matchVersion, name);
    stopSet = StopFilter.makeStopSet(stopWords);
  }
  
  public TokenStream tokenStream(String fieldName, Reader reader)
  {
    TokenStream result = new StandardTokenizer(matchVersion, reader);
    result = new StandardFilter(result);
    result = new LowerCaseFilter(result);
    if (stopSet != null) {
      result = new StopFilter(StopFilter.getEnablePositionIncrementsVersionDefault(matchVersion), result, stopSet);
    }
    result = new SnowballFilter(result, name);
    return result;
  }
  
  private class SavedStreams
  {
    Tokenizer source;
    TokenStream result;
    
    private SavedStreams() {}
    
    SavedStreams(SnowballAnalyzer.1 x1)
    {
      this();
    }
  }
  
  public TokenStream reusableTokenStream(String fieldName, Reader reader)
    throws IOException
  {
    if (overridesTokenStreamMethod) {
      return tokenStream(fieldName, reader);
    }
    SavedStreams streams = (SavedStreams)getPreviousTokenStream();
    if (streams == null)
    {
      streams = new SavedStreams(null);
      source = new StandardTokenizer(matchVersion, reader);
      result = new StandardFilter(source);
      result = new LowerCaseFilter(result);
      if (stopSet != null) {
        result = new StopFilter(StopFilter.getEnablePositionIncrementsVersionDefault(matchVersion), result, stopSet);
      }
      result = new SnowballFilter(result, name);
      setPreviousTokenStream(streams);
    }
    else
    {
      source.reset(reader);
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.analysis.snowball.SnowballAnalyzer
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.analysis.snowball;

import java.io.IOException;
import org.apache.lucene.analysis.Token;
import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.TermAttribute;
import org.tartarus.snowball.SnowballProgram;

public class SnowballFilter
  extends TokenFilter
{
  private SnowballProgram stemmer;
  private TermAttribute termAtt;
  
  public SnowballFilter(TokenStream input, SnowballProgram stemmer)
  {
    super(input);
    this.stemmer = stemmer;
    termAtt = ((TermAttribute)addAttribute(TermAttribute.class));
  }
  
  public SnowballFilter(TokenStream in, String name)
  {
    super(in);
    try
    {
      Class stemClass = Class.forName("org.tartarus.snowball.ext." + name + "Stemmer");
      stemmer = ((SnowballProgram)stemClass.newInstance());
    }
    catch (Exception e)
    {
      throw new RuntimeException(e.toString());
    }
    termAtt = ((TermAttribute)addAttribute(TermAttribute.class));
  }
  
  public final boolean incrementToken()
    throws IOException
  {
    if (input.incrementToken())
    {
      String originalTerm = termAtt.term();
      stemmer.setCurrent(originalTerm);
      stemmer.stem();
      String finalTerm = stemmer.getCurrent();
      if (!originalTerm.equals(finalTerm)) {
        termAtt.setTermBuffer(finalTerm);
      }
      return true;
    }
    return false;
  }
  
  /**
   * @deprecated
   */
  public final Token next(Token reusableToken)
    throws IOException
  {
    return super.next(reusableToken);
  }
  
  /**
   * @deprecated
   */
  public final Token next()
    throws IOException
  {
    return super.next();
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.analysis.snowball.SnowballFilter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.tartarus.snowball;

import java.lang.reflect.Method;

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

/* Location:
 * Qualified Name:     org.tartarus.snowball.Among
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.tartarus.snowball;

import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public abstract class SnowballProgram
{
  protected StringBuffer current;
  protected int cursor;
  protected int limit;
  protected int limit_backward;
  protected int bra;
  protected int ket;
  
  protected SnowballProgram()
  {
    current = new StringBuffer();
    setCurrent("");
  }
  
  public abstract boolean stem();
  
  public void setCurrent(String value)
  {
    current.replace(0, current.length(), value);
    cursor = 0;
    limit = current.length();
    limit_backward = 0;
    bra = cursor;
    ket = limit;
  }
  
  public String getCurrent()
  {
    String result = current.toString();
    
    current = new StringBuffer();
    return result;
  }
  
  protected void copy_from(SnowballProgram other)
  {
    current = current;
    cursor = cursor;
    limit = limit;
    limit_backward = limit_backward;
    bra = bra;
    ket = ket;
  }
  
  protected boolean in_grouping(char[] s, int min, int max)
  {
    if (cursor >= limit) {
      return false;
    }
    char ch = current.charAt(cursor);
    if ((ch > max) || (ch < min)) {
      return false;
    }
    ch = (char)(ch - min);
    if ((s[(ch >> '\003')] & '\001' << (ch & 0x7)) == 0) {
      return false;
    }
    cursor += 1;
    return true;
  }
  
  protected boolean in_grouping_b(char[] s, int min, int max)
  {
    if (cursor <= limit_backward) {
      return false;
    }
    char ch = current.charAt(cursor - 1);
    if ((ch > max) || (ch < min)) {
      return false;
    }
    ch = (char)(ch - min);
    if ((s[(ch >> '\003')] & '\001' << (ch & 0x7)) == 0) {
      return false;
    }
    cursor -= 1;
    return true;
  }
  
  protected boolean out_grouping(char[] s, int min, int max)
  {
    if (cursor >= limit) {
      return false;
    }
    char ch = current.charAt(cursor);
    if ((ch > max) || (ch < min))
    {
      cursor += 1;
      return true;
    }
    ch = (char)(ch - min);
    if ((s[(ch >> '\003')] & '\001' << (ch & 0x7)) == 0)
    {
      cursor += 1;
      return true;
    }
    return false;
  }
  
  protected boolean out_grouping_b(char[] s, int min, int max)
  {
    if (cursor <= limit_backward) {
      return false;
    }
    char ch = current.charAt(cursor - 1);
    if ((ch > max) || (ch < min))
    {
      cursor -= 1;
      return true;
    }
    ch = (char)(ch - min);
    if ((s[(ch >> '\003')] & '\001' << (ch & 0x7)) == 0)
    {
      cursor -= 1;
      return true;
    }
    return false;
  }
  
  protected boolean in_range(int min, int max)
  {
    if (cursor >= limit) {
      return false;
    }
    char ch = current.charAt(cursor);
    if ((ch > max) || (ch < min)) {
      return false;
    }
    cursor += 1;
    return true;
  }
  
  protected boolean in_range_b(int min, int max)
  {
    if (cursor <= limit_backward) {
      return false;
    }
    char ch = current.charAt(cursor - 1);
    if ((ch > max) || (ch < min)) {
      return false;
    }
    cursor -= 1;
    return true;
  }
  
  protected boolean out_range(int min, int max)
  {
    if (cursor >= limit) {
      return false;
    }
    char ch = current.charAt(cursor);
    if ((ch <= max) && (ch >= min)) {
      return false;
    }
    cursor += 1;
    return true;
  }
  
  protected boolean out_range_b(int min, int max)
  {
    if (cursor <= limit_backward) {
      return false;
    }
    char ch = current.charAt(cursor - 1);
    if ((ch <= max) && (ch >= min)) {
      return false;
    }
    cursor -= 1;
    return true;
  }
  
  protected boolean eq_s(int s_size, String s)
  {
    if (limit - cursor < s_size) {
      return false;
    }
    for (int i = 0; i != s_size; i++) {
      if (current.charAt(cursor + i) != s.charAt(i)) {
        return false;
      }
    }
    cursor += s_size;
    return true;
  }
  
  protected boolean eq_s_b(int s_size, String s)
  {
    if (cursor - limit_backward < s_size) {
      return false;
    }
    for (int i = 0; i != s_size; i++) {
      if (current.charAt(cursor - s_size + i) != s.charAt(i)) {
        return false;
      }
    }
    cursor -= s_size;
    return true;
  }
  
  protected boolean eq_v(StringBuffer s)
  {
    return eq_s(s.length(), s.toString());
  }
  
  protected boolean eq_v_b(StringBuffer s)
  {
    return eq_s_b(s.length(), s.toString());
  }
  
  protected int find_among(Among[] v, int v_size)
  {
    int i = 0;
    int j = v_size;
    
    int c = cursor;
    int l = limit;
    
    int common_i = 0;
    int common_j = 0;
    
    boolean first_key_inspected = false;
    for (;;)
    {
      int k = i + (j - i >> 1);
      int diff = 0;
      int common = common_i < common_j ? common_i : common_j;
      Among w = v[k];
      for (int i2 = common; i2 < s_size; i2++)
      {
        if (c + common == l)
        {
          diff = -1;
          break;
        }
        diff = current.charAt(c + common) - s.charAt(i2);
        if (diff != 0) {
          break;
        }
        common++;
      }
      if (diff < 0)
      {
        j = k;
        common_j = common;
      }
      else
      {
        i = k;
        common_i = common;
      }
      if (j - i <= 1)
      {
        if ((i > 0) || 
          (j == i)) {
          break;
        }
        if (first_key_inspected) {
          break;
        }
        first_key_inspected = true;
      }
    }
    for (;;)
    {
      Among w = v[i];
      if (common_i >= s_size)
      {
        cursor = (c + s_size);
        if (method == null) {
          return result;
        }
        boolean res;
        try
        {
          Object resobj = method.invoke(methodobject, new Object[0]);
          
          res = resobj.toString().equals("true");
        }
        catch (InvocationTargetException e)
        {
          res = false;
        }
        catch (IllegalAccessException e)
        {
          res = false;
        }
        cursor = (c + s_size);
        if (res) {
          return result;
        }
      }
      i = substring_i;
      if (i < 0) {
        return 0;
      }
    }
  }
  
  protected int find_among_b(Among[] v, int v_size)
  {
    int i = 0;
    int j = v_size;
    
    int c = cursor;
    int lb = limit_backward;
    
    int common_i = 0;
    int common_j = 0;
    
    boolean first_key_inspected = false;
    for (;;)
    {
      int k = i + (j - i >> 1);
      int diff = 0;
      int common = common_i < common_j ? common_i : common_j;
      Among w = v[k];
      for (int i2 = s_size - 1 - common; i2 >= 0; i2--)
      {
        if (c - common == lb)
        {
          diff = -1;
          break;
        }
        diff = current.charAt(c - 1 - common) - s.charAt(i2);
        if (diff != 0) {
          break;
        }
        common++;
      }
      if (diff < 0)
      {
        j = k;
        common_j = common;
      }
      else
      {
        i = k;
        common_i = common;
      }
      if (j - i <= 1)
      {
        if ((i > 0) || 
          (j == i) || 
          (first_key_inspected)) {
          break;
        }
        first_key_inspected = true;
      }
    }
    for (;;)
    {
      Among w = v[i];
      if (common_i >= s_size)
      {
        cursor = (c - s_size);
        if (method == null) {
          return result;
        }
        boolean res;
        try
        {
          Object resobj = method.invoke(methodobject, new Object[0]);
          
          res = resobj.toString().equals("true");
        }
        catch (InvocationTargetException e)
        {
          res = false;
        }
        catch (IllegalAccessException e)
        {
          res = false;
        }
        cursor = (c - s_size);
        if (res) {
          return result;
        }
      }
      i = substring_i;
      if (i < 0) {
        return 0;
      }
    }
  }
  
  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);
    limit += adjustment;
    if (cursor >= c_ket) {
      cursor += adjustment;
    } else if (cursor > c_bra) {
      cursor = c_bra;
    }
    return adjustment;
  }
  
  protected void slice_check()
  {
    if ((bra < 0) || (bra > ket) || (ket > limit) || (limit > current.length())) {
      System.err.println("faulty slice operation");
    }
  }
  
  protected void slice_from(String s)
  {
    slice_check();
    replace_s(bra, ket, s);
  }
  
  protected void slice_from(StringBuffer s)
  {
    slice_from(s.toString());
  }
  
  protected void slice_del()
  {
    slice_from("");
  }
  
  protected void insert(int c_bra, int c_ket, String s)
  {
    int adjustment = replace_s(c_bra, c_ket, s);
    if (c_bra <= bra) {
      bra += adjustment;
    }
    if (c_bra <= ket) {
      ket += adjustment;
    }
  }
  
  protected void insert(int c_bra, int c_ket, StringBuffer s)
  {
    insert(c_bra, c_ket, s.toString());
  }
  
  protected StringBuffer slice_to(StringBuffer s)
  {
    slice_check();
    int len = ket - bra;
    s.replace(0, s.length(), current.substring(bra, ket));
    return s;
  }
  
  protected StringBuffer assign_to(StringBuffer s)
  {
    s.replace(0, s.length(), current.substring(0, limit));
    return s;
  }
}

/* Location:
 * Qualified Name:     org.tartarus.snowball.SnowballProgram
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.tartarus.snowball;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.Reader;
import java.io.Writer;
import java.lang.reflect.Method;

public class TestApp
{
  private static void usage()
  {
    System.err.println("Usage: TestApp <algorithm> <input file> [-o <output file>]");
  }
  
  public static void main(String[] args)
    throws Throwable
  {
    if (args.length < 2)
    {
      usage();
      return;
    }
    Class stemClass = Class.forName("org.tartarus.snowball.ext." + args[0] + "Stemmer");
    
    SnowballProgram stemmer = (SnowballProgram)stemClass.newInstance();
    Method stemMethod = stemClass.getMethod("stem", new Class[0]);
    
    Reader reader = new InputStreamReader(new FileInputStream(args[1]));
    reader = new BufferedReader(reader);
    
    StringBuffer input = new StringBuffer();
    OutputStream outstream;
    if (args.length > 2)
    {
      OutputStream outstream;
      if ((args.length == 4) && (args[2].equals("-o"))) {
        outstream = new FileOutputStream(args[3]);
      } else {
        usage();
      }
    }
    else
    {
      outstream = System.out;
    }
    Writer output = new OutputStreamWriter(outstream);
    output = new BufferedWriter(output);
    
    int repeat = 1;
    if (args.length > 4) {
      repeat = Integer.parseInt(args[4]);
    }
    Object[] emptyArgs = new Object[0];
    int character;
    while ((character = reader.read()) != -1)
    {
      char ch = (char)character;
      if (Character.isWhitespace(ch))
      {
        if (input.length() > 0)
        {
          stemmer.setCurrent(input.toString());
          for (int i = repeat; i != 0; i--) {
            stemMethod.invoke(stemmer, emptyArgs);
          }
          output.write(stemmer.getCurrent());
          output.write(10);
          input.delete(0, input.length());
        }
      }
      else {
        input.append(Character.toLowerCase(ch));
      }
    }
    output.flush();
  }
}

/* Location:
 * Qualified Name:     org.tartarus.snowball.TestApp
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.tartarus.snowball.ext;

import org.tartarus.snowball.Among;
import org.tartarus.snowball.SnowballProgram;

public class DanishStemmer
  extends SnowballProgram
{
  private Among[] a_0 = { new Among("hed", -1, 1, "", this), new Among("ethed", 0, 1, "", this), new Among("ered", -1, 1, "", this), new Among("e", -1, 1, "", this), new Among("erede", 3, 1, "", this), new Among("ende", 3, 1, "", this), new Among("erende", 5, 1, "", this), new Among("ene", 3, 1, "", this), new Among("erne", 3, 1, "", this), new Among("ere", 3, 1, "", this), new Among("en", -1, 1, "", this), new Among("heden", 10, 1, "", this), new Among("eren", 10, 1, "", this), new Among("er", -1, 1, "", this), new Among("heder", 13, 1, "", this), new Among("erer", 13, 1, "", this), new Among("s", -1, 2, "", this), new Among("heds", 16, 1, "", this), new Among("es", 16, 1, "", this), new Among("endes", 18, 1, "", this), new Among("erendes", 19, 1, "", this), new Among("enes", 18, 1, "", this), new Among("ernes", 18, 1, "", this), new Among("eres", 18, 1, "", this), new Among("ens", 16, 1, "", this), new Among("hedens", 24, 1, "", this), new Among("erens", 24, 1, "", this), new Among("ers", 16, 1, "", this), new Among("ets", 16, 1, "", this), new Among("erets", 28, 1, "", this), new Among("et", -1, 1, "", this), new Among("eret", 30, 1, "", this) };
  private Among[] a_1 = { new Among("gd", -1, -1, "", this), new Among("dt", -1, -1, "", this), new Among("gt", -1, -1, "", this), new Among("kt", -1, -1, "", this) };
  private Among[] a_2 = { new Among("ig", -1, 1, "", this), new Among("lig", 0, 1, "", this), new Among("elig", 1, 1, "", this), new Among("els", -1, 1, "", this), new Among("l�st", -1, 2, "", this) };
  private static final char[] g_v = { '\021', 'A', '\020', '\001', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '0', '\000', '?' };
  private static final char[] g_s_ending = { '�', '�', '*', '\003', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\020' };
  private int I_x;
  private int I_p1;
  private StringBuffer S_ch = new StringBuffer();
  
  private void copy_from(DanishStemmer other)
  {
    I_x = I_x;
    I_p1 = I_p1;
    S_ch = S_ch;
    super.copy_from(other);
  }
  
  private boolean r_mark_regions()
  {
    I_p1 = limit;
    
    int v_1 = cursor;
    
    int c = cursor + 3;
    if ((0 > c) || (c > limit)) {
      return false;
    }
    cursor = c;
    
    I_x = cursor;
    cursor = v_1;
    for (;;)
    {
      int v_2 = cursor;
      if (in_grouping(g_v, 97, 248))
      {
        cursor = v_2;
        break;
      }
      cursor = v_2;
      if (cursor >= limit) {
        return false;
      }
      cursor += 1;
    }
    while (!out_grouping(g_v, 97, 248))
    {
      if (cursor >= limit) {
        return false;
      }
      cursor += 1;
    }
    I_p1 = cursor;
    if (I_p1 < I_x) {
      I_p1 = I_x;
    }
    return true;
  }
  
  private boolean r_main_suffix()
  {
    int v_1 = limit - cursor;
    if (cursor < I_p1) {
      return false;
    }
    cursor = I_p1;
    int v_2 = limit_backward;
    limit_backward = cursor;
    cursor = (limit - v_1);
    
    ket = cursor;
    
    int among_var = find_among_b(a_0, 32);
    if (among_var == 0)
    {
      limit_backward = v_2;
      return false;
    }
    bra = cursor;
    limit_backward = v_2;
    switch (among_var)
    {
    case 0: 
      return false;
    case 1: 
      slice_del();
      break;
    case 2: 
      if (!in_grouping_b(g_s_ending, 97, 229)) {
        return false;
      }
      slice_del();
    }
    return true;
  }
  
  private boolean r_consonant_pair()
  {
    int v_1 = limit - cursor;
    
    int v_2 = limit - cursor;
    if (cursor < I_p1) {
      return false;
    }
    cursor = I_p1;
    int v_3 = limit_backward;
    limit_backward = cursor;
    cursor = (limit - v_2);
    
    ket = cursor;
    if (find_among_b(a_1, 4) == 0)
    {
      limit_backward = v_3;
      return false;
    }
    bra = cursor;
    limit_backward = v_3;
    cursor = (limit - v_1);
    if (cursor <= limit_backward) {
      return false;
    }
    cursor -= 1;
    
    bra = cursor;
    
    slice_del();
    return true;
  }
  
  private boolean r_other_suffix()
  {
    int v_1 = limit - cursor;
    
    ket = cursor;
    if (eq_s_b(2, "st"))
    {
      bra = cursor;
      if (eq_s_b(2, "ig")) {
        slice_del();
      }
    }
    cursor = (limit - v_1);
    
    int v_2 = limit - cursor;
    if (cursor < I_p1) {
      return false;
    }
    cursor = I_p1;
    int v_3 = limit_backward;
    limit_backward = cursor;
    cursor = (limit - v_2);
    
    ket = cursor;
    
    int among_var = find_among_b(a_2, 5);
    if (among_var == 0)
    {
      limit_backward = v_3;
      return false;
    }
    bra = cursor;
    limit_backward = v_3;
    switch (among_var)
    {
    case 0: 
      return false;
    case 1: 
      slice_del();
      
      int v_4 = limit - cursor;
      if (!r_consonant_pair()) {}
      cursor = (limit - v_4);
      break;
    case 2: 
      slice_from("l�s");
    }
    return true;
  }
  
  private boolean r_undouble()
  {
    int v_1 = limit - cursor;
    if (cursor < I_p1) {
      return false;
    }
    cursor = I_p1;
    int v_2 = limit_backward;
    limit_backward = cursor;
    cursor = (limit - v_1);
    
    ket = cursor;
    if (!out_grouping_b(g_v, 97, 248))
    {
      limit_backward = v_2;
      return false;
    }
    bra = cursor;
    
    S_ch = slice_to(S_ch);
    limit_backward = v_2;
    if (!eq_v_b(S_ch)) {
      return false;
    }
    slice_del();
    return true;
  }
  
  public boolean stem()
  {
    int v_1 = cursor;
    if (!r_mark_regions()) {}
    cursor = v_1;
    
    limit_backward = cursor;cursor = limit;
    
    int v_2 = limit - cursor;
    if (!r_main_suffix()) {}
    cursor = (limit - v_2);
    
    int v_3 = limit - cursor;
    if (!r_consonant_pair()) {}
    cursor = (limit - v_3);
    
    int v_4 = limit - cursor;
    if (!r_other_suffix()) {}
    cursor = (limit - v_4);
    
    int v_5 = limit - cursor;
    if (!r_undouble()) {}
    cursor = (limit - v_5);
    cursor = limit_backward;return true;
  }
}

/* Location:
 * Qualified Name:     org.tartarus.snowball.ext.DanishStemmer
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.tartarus.snowball.ext;

import org.tartarus.snowball.Among;
import org.tartarus.snowball.SnowballProgram;

public class DutchStemmer
  extends SnowballProgram
{
  private Among[] a_0 = { new Among("", -1, 6, "", this), new Among("�", 0, 1, "", this), new Among("�", 0, 1, "", this), new Among("�", 0, 2, "", this), new Among("�", 0, 2, "", this), new Among("�", 0, 3, "", this), new Among("�", 0, 3, "", this), new Among("�", 0, 4, "", this), new Among("�", 0, 4, "", this), new Among("�", 0, 5, "", this), new Among("�", 0, 5, "", this) };
  private Among[] a_1 = { new Among("", -1, 3, "", this), new Among("I", 0, 2, "", this), new Among("Y", 0, 1, "", this) };
  private Among[] a_2 = { new Among("dd", -1, -1, "", this), new Among("kk", -1, -1, "", this), new Among("tt", -1, -1, "", this) };
  private Among[] a_3 = { new Among("ene", -1, 2, "", this), new Among("se", -1, 3, "", this), new Among("en", -1, 2, "", this), new Among("heden", 2, 1, "", this), new Among("s", -1, 3, "", this) };
  private Among[] a_4 = { new Among("end", -1, 1, "", this), new Among("ig", -1, 2, "", this), new Among("ing", -1, 1, "", this), new Among("lijk", -1, 3, "", this), new Among("baar", -1, 4, "", this), new Among("bar", -1, 5, "", this) };
  private Among[] a_5 = { new Among("aa", -1, -1, "", this), new Among("ee", -1, -1, "", this), new Among("oo", -1, -1, "", this), new Among("uu", -1, -1, "", this) };
  private static final char[] g_v = { '\021', 'A', '\020', '\001', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '?' };
  private static final char[] g_v_I = { '\001', '\000', '\000', '\021', 'A', '\020', '\001', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '?' };
  private static final char[] g_v_j = { '\021', 'C', '\020', '\001', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '?' };
  private int I_p2;
  private int I_p1;
  private boolean B_e_found;
  
  private void copy_from(DutchStemmer other)
  {
    I_p2 = I_p2;
    I_p1 = I_p1;
    B_e_found = B_e_found;
    super.copy_from(other);
  }
  
  private boolean r_prelude()
  {
    int v_1 = cursor;
    int v_2;
    for (;;)
    {
      v_2 = cursor;
      
      bra = cursor;
      
      int among_var = find_among(a_0, 11);
      if (among_var == 0) {
        break;
      }
      ket = cursor;
      switch (among_var)
      {
      case 0: 
        break;
      case 1: 
        slice_from("a");
        break;
      case 2: 
        slice_from("e");
        break;
      case 3: 
        slice_from("i");
        break;
      case 4: 
        slice_from("o");
        break;
      case 5: 
        slice_from("u");
        break;
      case 6: 
        if (cursor >= limit) {
          break label163;
        }
        cursor += 1;
      }
    }
    label163:
    cursor = v_2;
    cursor = v_1;
    
    int v_3 = cursor;
    
    bra = cursor;
    if (!eq_s(1, "y"))
    {
      cursor = v_3;
    }
    else
    {
      ket = cursor;
      
      slice_from("Y");
    }
    int v_4 = cursor;
    for (;;)
    {
      int v_5 = cursor;
      if (in_grouping(g_v, 97, 232))
      {
        bra = cursor;
        
        int v_6 = cursor;
        if (eq_s(1, "i"))
        {
          ket = cursor;
          if (in_grouping(g_v, 97, 232))
          {
            slice_from("I");
            break label348;
          }
        }
        cursor = v_6;
        if (eq_s(1, "y"))
        {
          ket = cursor;
          
          slice_from("Y");
          label348:
          cursor = v_5;
          break;
        }
      }
      cursor = v_5;
      if (cursor >= limit) {
        break label390;
      }
      cursor += 1;
    }
    label390:
    cursor = v_4;
    return true;
  }
  
  private boolean r_mark_regions()
  {
    I_p1 = limit;
    I_p2 = limit;
    while (!in_grouping(g_v, 97, 232))
    {
      if (cursor >= limit) {
        return false;
      }
      cursor += 1;
    }
    while (!out_grouping(g_v, 97, 232))
    {
      if (cursor >= limit) {
        return false;
      }
      cursor += 1;
    }
    I_p1 = cursor;
    if (I_p1 < 3) {
      I_p1 = 3;
    }
    while (!in_grouping(g_v, 97, 232))
    {
      if (cursor >= limit) {
        return false;
      }
      cursor += 1;
    }
    while (!out_grouping(g_v, 97, 232))
    {
      if (cursor >= limit) {
        return false;
      }
      cursor += 1;
    }
    I_p2 = cursor;
    return true;
  }
  
  private boolean r_postlude()
  {
    int v_1;
    for (;;)
    {
      v_1 = cursor;
      
      bra = cursor;
      
      int among_var = find_among(a_1, 3);
      if (among_var == 0) {
        break;
      }
      ket = cursor;
      switch (among_var)
      {
      case 0: 
        break;
      case 1: 
        slice_from("y");
        break;
      case 2: 
        slice_from("i");
        break;
      case 3: 
        if (cursor >= limit) {
          break label116;
        }
        cursor += 1;
      }
    }
    label116:
    cursor = v_1;
    return true;
  }
  
  private boolean r_R1()
  {
    if (I_p1 > cursor) {
      return false;
    }
    return true;
  }
  
  private boolean r_R2()
  {
    if (I_p2 > cursor) {
      return false;
    }
    return true;
  }
  
  private boolean r_undouble()
  {
    int v_1 = limit - cursor;
    if (find_among_b(a_2, 3) == 0) {
      return false;
    }
    cursor = (limit - v_1);
    
    ket = cursor;
    if (cursor <= limit_backward) {
      return false;
    }
    cursor -= 1;
    
    bra = cursor;
    
    slice_del();
    return true;
  }
  
  private boolean r_e_ending()
  {
    B_e_found = false;
    
    ket = cursor;
    if (!eq_s_b(1, "e")) {
      return false;
    }
    bra = cursor;
    if (!r_R1()) {
      return false;
    }
    int v_1 = limit - cursor;
    if (!out_grouping_b(g_v, 97, 232)) {
      return false;
    }
    cursor = (limit - v_1);
    
    slice_del();
    
    B_e_found = true;
    if (!r_undouble()) {
      return false;
    }
    return true;
  }
  
  private boolean r_en_ending()
  {
    if (!r_R1()) {
      return false;
    }
    int v_1 = limit - cursor;
    if (!out_grouping_b(g_v, 97, 232)) {
      return false;
    }
    cursor = (limit - v_1);
    
    int v_2 = limit - cursor;
    if (eq_s_b(3, "gem")) {
      return false;
    }
    cursor = (limit - v_2);
    
    slice_del();
    if (!r_undouble()) {
      return false;
    }
    return true;
  }
  
  private boolean r_standard_suffix()
  {
    int v_1 = limit - cursor;
    
    ket = cursor;
    
    int among_var = find_among_b(a_3, 5);
    if (among_var != 0)
    {
      bra = cursor;
      switch (among_var)
      {
      case 0: 
        break;
      case 1: 
        if (r_R1()) {
          slice_from("heid");
        }
        break;
      case 2: 
        if (r_en_ending()) {
          break;
        }
      case 3: 
        if ((goto 140) && 
        
          (r_R1())) {
          if (out_grouping_b(g_v_j, 97, 232)) {
            slice_del();
          }
        }
        break;
      }
    }
    cursor = (limit - v_1);
    
    int v_2 = limit - cursor;
    if (!r_e_ending()) {}
    cursor = (limit - v_2);
    
    int v_3 = limit - cursor;
    
    ket = cursor;
    if (eq_s_b(4, "heid"))
    {
      bra = cursor;
      if (r_R2())
      {
        int v_4 = limit - cursor;
        if (!eq_s_b(1, "c"))
        {
          cursor = (limit - v_4);
          
          slice_del();
          
          ket = cursor;
          if (eq_s_b(2, "en"))
          {
            bra = cursor;
            if (r_en_ending()) {}
          }
        }
      }
    }
    cursor = (limit - v_3);
    
    int v_5 = limit - cursor;
    
    ket = cursor;
    
    among_var = find_among_b(a_4, 6);
    if (among_var != 0)
    {
      bra = cursor;
      switch (among_var)
      {
      case 0: 
        break;
      case 1: 
        if (r_R2())
        {
          slice_del();
          
          int v_6 = limit - cursor;
          
          ket = cursor;
          if (eq_s_b(2, "ig"))
          {
            bra = cursor;
            if (r_R2())
            {
              int v_7 = limit - cursor;
              if (!eq_s_b(1, "e"))
              {
                cursor = (limit - v_7);
                
                slice_del();
                break;
              }
            }
          }
          cursor = (limit - v_6);
          if (r_undouble()) {
            break;
          }
        }
        break;
      case 2: 
        if ((goto 637) && 
        
          (r_R2()))
        {
          int v_8 = limit - cursor;
          if (!eq_s_b(1, "e"))
          {
            cursor = (limit - v_8);
            
            slice_del();
          }
        }
        break;
      case 3: 
        if (r_R2())
        {
          slice_del();
          if (r_e_ending()) {
            break;
          }
        }
        break;
      case 4: 
        if ((goto 637) && 
        
          (r_R2())) {
          slice_del();
        }
        break;
      case 5: 
        if (r_R2()) {
          if (B_e_found) {
            slice_del();
          }
        }
        break;
      }
    }
    cursor = (limit - v_5);
    
    int v_9 = limit - cursor;
    if (out_grouping_b(g_v_I, 73, 232))
    {
      int v_10 = limit - cursor;
      if (find_among_b(a_5, 4) != 0) {
        if (out_grouping_b(g_v, 97, 232))
        {
          cursor = (limit - v_10);
          
          ket = cursor;
          if (cursor > limit_backward)
          {
            cursor -= 1;
            
            bra = cursor;
            
            slice_del();
          }
        }
      }
    }
    cursor = (limit - v_9);
    return true;
  }
  
  public boolean stem()
  {
    int v_1 = cursor;
    if (!r_prelude()) {}
    cursor = v_1;
    
    int v_2 = cursor;
    if (!r_mark_regions()) {}
    cursor = v_2;
    
    limit_backward = cursor;cursor = limit;
    
    int v_3 = limit - cursor;
    if (!r_standard_suffix()) {}
    cursor = (limit - v_3);
    cursor = limit_backward;
    int v_4 = cursor;
    if (!r_postlude()) {}
    cursor = v_4;
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tartarus.snowball.ext.DutchStemmer
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.tartarus.snowball.ext;

import org.tartarus.snowball.Among;
import org.tartarus.snowball.SnowballProgram;

public class EnglishStemmer
  extends SnowballProgram
{
  private Among[] a_0 = { new Among("arsen", -1, -1, "", this), new Among("commun", -1, -1, "", this), new Among("gener", -1, -1, "", this) };
  private Among[] a_1 = { new Among("'", -1, 1, "", this), new Among("'s'", 0, 1, "", this), new Among("'s", -1, 1, "", this) };
  private Among[] a_2 = { new Among("ied", -1, 2, "", this), new Among("s", -1, 3, "", this), new Among("ies", 1, 2, "", this), new Among("sses", 1, 1, "", this), new Among("ss", 1, -1, "", this), new Among("us", 1, -1, "", this) };
  private Among[] a_3 = { new Among("", -1, 3, "", this), new Among("bb", 0, 2, "", this), new Among("dd", 0, 2, "", this), new Among("ff", 0, 2, "", this), new Among("gg", 0, 2, "", this), new Among("bl", 0, 1, "", this), new Among("mm", 0, 2, "", this), new Among("nn", 0, 2, "", this), new Among("pp", 0, 2, "", this), new Among("rr", 0, 2, "", this), new Among("at", 0, 1, "", this), new Among("tt", 0, 2, "", this), new Among("iz", 0, 1, "", this) };
  private Among[] a_4 = { new Among("ed", -1, 2, "", this), new Among("eed", 0, 1, "", this), new Among("ing", -1, 2, "", this), new Among("edly", -1, 2, "", this), new Among("eedly", 3, 1, "", this), new Among("ingly", -1, 2, "", this) };
  private Among[] a_5 = { new Among("anci", -1, 3, "", this), new Among("enci", -1, 2, "", this), new Among("ogi", -1, 13, "", this), new Among("li", -1, 16, "", this), new Among("bli", 3, 12, "", this), new Among("abli", 4, 4, "", this), new Among("alli", 3, 8, "", this), new Among("fulli", 3, 14, "", this), new Among("lessli", 3, 15, "", this), new Among("ousli", 3, 10, "", this), new Among("entli", 3, 5, "", this), new Among("aliti", -1, 8, "", this), new Among("biliti", -1, 12, "", this), new Among("iviti", -1, 11, "", this), new Among("tional", -1, 1, "", this), new Among("ational", 14, 7, "", this), new Among("alism", -1, 8, "", this), new Among("ation", -1, 7, "", this), new Among("ization", 17, 6, "", this), new Among("izer", -1, 6, "", this), new Among("ator", -1, 7, "", this), new Among("iveness", -1, 11, "", this), new Among("fulness", -1, 9, "", this), new Among("ousness", -1, 10, "", this) };
  private Among[] a_6 = { new Among("icate", -1, 4, "", this), new Among("ative", -1, 6, "", this), new Among("alize", -1, 3, "", this), new Among("iciti", -1, 4, "", this), new Among("ical", -1, 4, "", this), new Among("tional", -1, 1, "", this), new Among("ational", 5, 2, "", this), new Among("ful", -1, 5, "", this), new Among("ness", -1, 5, "", this) };
  private Among[] a_7 = { new Among("ic", -1, 1, "", this), new Among("ance", -1, 1, "", this), new Among("ence", -1, 1, "", this), new Among("able", -1, 1, "", this), new Among("ible", -1, 1, "", this), new Among("ate", -1, 1, "", this), new Among("ive", -1, 1, "", this), new Among("ize", -1, 1, "", this), new Among("iti", -1, 1, "", this), new Among("al", -1, 1, "", this), new Among("ism", -1, 1, "", this), new Among("ion", -1, 2, "", this), new Among("er", -1, 1, "", this), new Among("ous", -1, 1, "", this), new Among("ant", -1, 1, "", this), new Among("ent", -1, 1, "", this), new Among("ment", 15, 1, "", this), new Among("ement", 16, 1, "", this) };
  private Among[] a_8 = { new Among("e", -1, 1, "", this), new Among("l", -1, 2, "", this) };
  private Among[] a_9 = { new Among("succeed", -1, -1, "", this), new Among("proceed", -1, -1, "", this), new Among("exceed", -1, -1, "", this), new Among("canning", -1, -1, "", this), new Among("inning", -1, -1, "", this), new Among("earring", -1, -1, "", this), new Among("herring", -1, -1, "", this), new Among("outing", -1, -1, "", this) };
  private Among[] a_10 = { new Among("andes", -1, -1, "", this), new Among("atlas", -1, -1, "", this), new Among("bias", -1, -1, "", this), new Among("cosmos", -1, -1, "", this), new Among("dying", -1, 3, "", this), new Among("early", -1, 9, "", this), new Among("gently", -1, 7, "", this), new Among("howe", -1, -1, "", this), new Among("idly", -1, 6, "", this), new Among("lying", -1, 4, "", this), new Among("news", -1, -1, "", this), new Among("only", -1, 10, "", this), new Among("singly", -1, 11, "", this), new Among("skies", -1, 2, "", this), new Among("skis", -1, 1, "", this), new Among("sky", -1, -1, "", this), new Among("tying", -1, 5, "", this), new Among("ugly", -1, 8, "", this) };
  private static final char[] g_v = { '\021', 'A', '\020', '\001' };
  private static final char[] g_v_WXY = { '\001', '\021', 'A', '�', '\001' };
  private static final char[] g_valid_LI = { '7', '?', '\002' };
  private boolean B_Y_found;
  private int I_p2;
  private int I_p1;
  
  private void copy_from(EnglishStemmer other)
  {
    B_Y_found = B_Y_found;
    I_p2 = I_p2;
    I_p1 = I_p1;
    super.copy_from(other);
  }
  
  private boolean r_prelude()
  {
    B_Y_found = false;
    
    int v_1 = cursor;
    
    bra = cursor;
    if (eq_s(1, "'"))
    {
    
1 2 3 4 5 6 7 8 9

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd