Class TypeTokenFilter

    • Constructor Detail

      • TypeTokenFilter

        public TypeTokenFilter​(TokenStream input,
                               Set<String> stopTypes,
                               boolean useWhiteList)
        Create a new TypeTokenFilter.
        Parameters:
        input - the TokenStream to consume
        stopTypes - the types to filter
        useWhiteList - if true, then tokens whose type is in stopTypes will be kept, otherwise they will be filtered out
    • Method Detail

      • accept

        protected boolean accept()
        By default accept the token if its type is not a stop type. When the useWhiteList parameter is set to true then accept the token if its type is contained in the stopTypes
        Specified by:
        accept in class FilteringTokenFilter