Class ProtectedTermFilter

  • All Implemented Interfaces:
    Closeable, AutoCloseable

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

      • 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)