Package org.terrier.terms
Class CropTerm
- java.lang.Object
-
- org.terrier.terms.CropTerm
-
- All Implemented Interfaces:
TermPipeline
public final class CropTerm extends java.lang.Object implements TermPipeline
Reduces the size of terms passing through the term pipeline to the maximum allowed size for this indexing run. The crop term pipeline class has been provided as some term pipeline implementators (eg SnowballGermanStemmer) may actually lengthen words that did previously fit in the indexing.- Author:
- Craig Macdonald
-
-
Field Summary
Fields Modifier and Type Field Description protected static intmaxLenMaximum length a term can beprotected TermPipelinenextThe next object in the term pipeline
-
Constructor Summary
Constructors Constructor Description CropTerm(TermPipeline _next)Creates a new CropTerm pipeline object, which can be used in the term pipeline
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprocessTerm(java.lang.String t)Reduces the term to the maximum allowed size for this indexing runbooleanreset()Implements the default operation for all TermPipeline subclasses; By default do nothing.
-
-
-
Field Detail
-
maxLen
protected static final int maxLen
Maximum length a term can be
-
next
protected final TermPipeline next
The next object in the term pipeline
-
-
Constructor Detail
-
CropTerm
public CropTerm(TermPipeline _next)
Creates a new CropTerm pipeline object, which can be used in the term pipeline- Parameters:
_next- The next termpipeline object to pass the term onto.
-
-
Method Detail
-
processTerm
public void processTerm(java.lang.String t)
Reduces the term to the maximum allowed size for this indexing run- Specified by:
processTermin interfaceTermPipeline- Parameters:
t- String the term to check the length of.
-
reset
public boolean reset()
Implements the default operation for all TermPipeline subclasses; By default do nothing. This method should be overrided by any TermPipeline that want to implements doc/query oriented lifecycle.- Specified by:
resetin interfaceTermPipeline- Returns:
- return how the reset has gone
-
-