Class SingleLabelFilterBase

All Implemented Interfaces:
AcceptingVisitor
Direct Known Subclasses:
GenitiveLabelFilter, MinLengthLabelFilter, NumericLabelFilter, QueryLabelFilter, StopLabelFilter, StopWordLabelFilter

public abstract class SingleLabelFilterBase extends ContextLabelFilter
A base for ContextLabelFilter implementations that handle each label independently.
  • Method Details

    • filter

      public void filter(PreprocessingContext context, boolean[] acceptedStems, boolean[] acceptedPhrases)
      Description copied from class: ContextLabelFilter
      Called to perform label filtering.
      Specified by:
      filter in class ContextLabelFilter
      Parameters:
      context - contains words and phrases to be filtered
      acceptedStems - the filter should set to false those elements that correspond to the stems to be filtered out
      acceptedPhrases - the filter should set to false those elements that correspond to the phrases to be filtered out
    • acceptWord

      public abstract boolean acceptWord(PreprocessingContext context, int wordIndex)
      Should return true if the word located at wordIndex is to be accepted, false otherwise.
      Parameters:
      context - provides access to all information about the word
      wordIndex - index of the word for which decision is to be made
    • acceptPhrase

      public abstract boolean acceptPhrase(PreprocessingContext context, int phraseIndex)
      Should return true if the phrase located at phraseIndex is to be accepted, false otherwise.
      Parameters:
      context - provides access to all information about the phrase
      phraseIndex - index of the phrase for which decision is to be made