it.unimi.di.mg4j.index.snowball
Class AbstractSnowballTermProcessor

java.lang.Object
  extended by it.unimi.di.mg4j.index.snowball.AbstractSnowballTermProcessor
All Implemented Interfaces:
TermProcessor, FlyweightPrototype<TermProcessor>, Serializable, Cloneable
Direct Known Subclasses:
DanishStemmer, DutchStemmer, EnglishStemmer, FinnishStemmer, FrenchStemmer, German2Stemmer, GermanStemmer, HungarianStemmer, ItalianStemmer, KraaijPohlmannStemmer, LovinsStemmer, NorwegianStemmer, PorterStemmer, PortugueseStemmer, SpanishStemmer, SwedishStemmer

public abstract class AbstractSnowballTermProcessor
extends Object
implements TermProcessor, Cloneable

See Also:
Serialized Form

Field Summary
protected  char[] array
           
protected  int bra
           
protected  MutableString copy
           
protected  MutableString current
           
protected  int cursor
           
protected  int ket
           
protected  int limit
           
protected  int limit_backward
           
 
Constructor Summary
AbstractSnowballTermProcessor()
           
 
Method Summary
protected  MutableString assign_to(MutableString s)
           
protected  void copy_from(AbstractSnowballTermProcessor other)
           
 AbstractSnowballTermProcessor copy()
           
protected  boolean eq_s_b(int s_size, String s)
           
protected  boolean eq_s(int s_size, String s)
           
protected  boolean eq_v_b(MutableString s)
           
protected  boolean eq_v(MutableString s)
           
protected  int find_among_b(Among[] v, int v_size)
           
protected  int find_among(Among[] v, int v_size)
           
protected  boolean in_grouping_b(char[] s, int min, int max)
           
protected  boolean in_grouping(char[] s, int min, int max)
           
protected  boolean in_range_b(int min, int max)
           
protected  boolean in_range(int min, int max)
           
protected  void insert(int c_bra, int c_ket, MutableString s)
           
protected  void insert(int c_bra, int c_ket, String s)
           
protected  boolean out_grouping_b(char[] s, int min, int max)
           
protected  boolean out_grouping(char[] s, int min, int max)
           
protected  boolean out_range_b(int min, int max)
           
protected  boolean out_range(int min, int max)
           
 boolean processPrefix(MutableString prefix)
          Processes the given prefix, leaving the result in the same mutable string.
 boolean processTerm(MutableString term)
          Processes the given term, leaving the result in the same mutable string.
protected  int replace_s(int c_bra, int c_ket, String s)
           
protected  void slice_check()
           
protected  void slice_del()
           
protected  void slice_from(String s)
           
protected  MutableString slice_to(MutableString s)
           
protected abstract  boolean stem()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

protected MutableString current

copy

protected MutableString copy

array

protected char[] array

cursor

protected int cursor

limit

protected int limit

limit_backward

protected int limit_backward

bra

protected int bra

ket

protected int ket
Constructor Detail

AbstractSnowballTermProcessor

public AbstractSnowballTermProcessor()
Method Detail

stem

protected abstract boolean stem()

processTerm

public boolean processTerm(MutableString term)
Description copied from interface: TermProcessor
Processes the given term, leaving the result in the same mutable string.

Specified by:
processTerm in interface TermProcessor
Parameters:
term - a mutable string containing the term to be processed, or null.
Returns:
true if the term is not null and should be indexed, false otherwise.

processPrefix

public boolean processPrefix(MutableString prefix)
Description copied from interface: TermProcessor
Processes the given prefix, leaving the result in the same mutable string.

This method is not used during the indexing phase, but rather at query time. If the user wants to specify a prefix query, it is sometimes necessary to transform the prefix (e.g., DowncaseTermProcessor.processPrefix(MutableString) downcasing it).

It is of course unlikely that this method returns false, as it is usually not possible to foresee which are the prefixes of indexable words. In case no natural transformation applies, this method should leave its argument unchanged.

Specified by:
processPrefix in interface TermProcessor
Parameters:
prefix - a mutable string containing a prefix to be processed, or null.
Returns:
true if the prefix is not null and there might be an indexed word starting with prefix, false otherwise.

copy

public AbstractSnowballTermProcessor copy()
Specified by:
copy in interface TermProcessor
Specified by:
copy in interface FlyweightPrototype<TermProcessor>

copy_from

protected void copy_from(AbstractSnowballTermProcessor other)

in_grouping

protected boolean in_grouping(char[] s,
                              int min,
                              int max)

in_grouping_b

protected boolean in_grouping_b(char[] s,
                                int min,
                                int max)

out_grouping

protected boolean out_grouping(char[] s,
                               int min,
                               int max)

out_grouping_b

protected boolean out_grouping_b(char[] s,
                                 int min,
                                 int max)

in_range

protected boolean in_range(int min,
                           int max)

in_range_b

protected boolean in_range_b(int min,
                             int max)

out_range

protected boolean out_range(int min,
                            int max)

out_range_b

protected boolean out_range_b(int min,
                              int max)

eq_s

protected boolean eq_s(int s_size,
                       String s)

eq_s_b

protected boolean eq_s_b(int s_size,
                         String s)

eq_v

protected boolean eq_v(MutableString s)

eq_v_b

protected boolean eq_v_b(MutableString s)

find_among

protected int find_among(Among[] v,
                         int v_size)

find_among_b

protected int find_among_b(Among[] v,
                           int v_size)

replace_s

protected int replace_s(int c_bra,
                        int c_ket,
                        String s)

slice_check

protected void slice_check()

slice_from

protected void slice_from(String s)

slice_del

protected void slice_del()

insert

protected void insert(int c_bra,
                      int c_ket,
                      String s)

insert

protected void insert(int c_bra,
                      int c_ket,
                      MutableString s)

slice_to

protected MutableString slice_to(MutableString s)

assign_to

protected MutableString assign_to(MutableString s)