Class ProtectedTermFilter

All Implemented Interfaces:
Closeable, AutoCloseable, Unwrappable<TokenStream>

public class ProtectedTermFilter extends ConditionalTokenFilter
A ConditionalTokenFilter that only applies its wrapped filters to tokens that are not contained in a protected set.
  • Constructor Details

    • ProtectedTermFilter

      public ProtectedTermFilter(CharArraySet protectedTerms, TokenStream input, Function<TokenStream,TokenStream> inputFactory)
      Creates a new ProtectedTermFilter
      protectedTerms - the set of terms to skip the wrapped filters for
      input - the input TokenStream
      inputFactory - a factory function to create the wrapped filter(s)
  • Method Details