Class 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 int maxLen
      Maximum length a term can be
      protected TermPipeline next
      The 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
      void processTerm​(java.lang.String t)
      Reduces the term to the maximum allowed size for this indexing run
      boolean reset()
      Implements the default operation for all TermPipeline subclasses; By default do nothing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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:
        processTerm in interface TermPipeline
        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:
        reset in interface TermPipeline
        Returns:
        return how the reset has gone