Class AbstractSnowballTermProcessor
- java.lang.Object
-
- it.unimi.di.big.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
Fields Modifier and Type Field Description protected char[]arrayprotected intbraprotected MutableStringcopyprotected MutableStringcurrentprotected intcursorprotected intketprotected intlimitprotected intlimit_backward
-
Constructor Summary
Constructors Constructor Description AbstractSnowballTermProcessor()
-
Method Summary
Modifier and Type Method Description protected MutableStringassign_to(MutableString s)AbstractSnowballTermProcessorcopy()protected voidcopy_from(AbstractSnowballTermProcessor other)protected booleaneq_s(int s_size, String s)protected booleaneq_s_b(int s_size, String s)protected booleaneq_v(MutableString s)protected booleaneq_v_b(MutableString s)protected intfind_among(Among[] v, int v_size)protected intfind_among_b(Among[] v, int v_size)protected booleanin_grouping(char[] s, int min, int max)protected booleanin_grouping_b(char[] s, int min, int max)protected booleanin_range(int min, int max)protected booleanin_range_b(int min, int max)protected voidinsert(int c_bra, int c_ket, MutableString s)protected voidinsert(int c_bra, int c_ket, String s)protected booleanout_grouping(char[] s, int min, int max)protected booleanout_grouping_b(char[] s, int min, int max)protected booleanout_range(int min, int max)protected booleanout_range_b(int min, int max)booleanprocessPrefix(MutableString prefix)Processes the given prefix, leaving the result in the same mutable string.booleanprocessTerm(MutableString term)Processes the given term, leaving the result in the same mutable string.protected intreplace_s(int c_bra, int c_ket, String s)protected voidslice_check()protected voidslice_del()protected voidslice_from(String s)protected MutableStringslice_to(MutableString s)protected abstract booleanstem()
-
-
-
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
-
-
Method Detail
-
stem
protected abstract boolean stem()
-
processTerm
public boolean processTerm(MutableString term)
Description copied from interface:TermProcessorProcesses the given term, leaving the result in the same mutable string.- Specified by:
processTermin interfaceTermProcessor- Parameters:
term- a mutable string containing the term to be processed, ornull.- Returns:
- true if the term is not
nulland should be indexed, false otherwise.
-
processPrefix
public boolean processPrefix(MutableString prefix)
Description copied from interface:TermProcessorProcesses 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:
processPrefixin interfaceTermProcessor- Parameters:
prefix- a mutable string containing a prefix to be processed, ornull.- Returns:
- true if the prefix is not
nulland there might be an indexed word starting withprefix, false otherwise.
-
copy
public AbstractSnowballTermProcessor copy()
- Specified by:
copyin interfaceFlyweightPrototype<TermProcessor>- Specified by:
copyin interfaceTermProcessor
-
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)
-
-