Class AlphaNumericFilter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.lucene.util.Unwrappable<org.apache.lucene.analysis.TokenStream>

    public final class AlphaNumericFilter
    extends AbstractTokenizingFilter
    A simple alphanumeric filter that removes non-alphanumeric characters from the terms. If a term contains a non-alphanumeric character it may be split into multiple terms.
    Filtering examples
    termresults in
    bobbob
    bob-catbob cat
    #$%[skipped]
    Author:
    jeremy long
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource

        org.apache.lucene.util.AttributeSource.State
    • Field Summary

      • Fields inherited from class org.apache.lucene.analysis.TokenFilter

        input
      • Fields inherited from class org.apache.lucene.analysis.TokenStream

        DEFAULT_TOKEN_ATTRIBUTE_FACTORY
    • Constructor Summary

      Constructors 
      Constructor Description
      AlphaNumericFilter​(org.apache.lucene.analysis.TokenStream stream)
      Constructs a new AlphaNumericFilter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void end()
      boolean equals​(java.lang.Object obj)
      int hashCode()
      boolean incrementToken()
      void reset()
      • Methods inherited from class org.apache.lucene.analysis.TokenFilter

        close, unwrap
      • Methods inherited from class org.apache.lucene.util.AttributeSource

        addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AlphaNumericFilter

        public AlphaNumericFilter​(org.apache.lucene.analysis.TokenStream stream)
        Constructs a new AlphaNumericFilter.
        Parameters:
        stream - the TokenStream that this filter will process
    • Method Detail

      • incrementToken

        public boolean incrementToken()
                               throws java.io.IOException
        Specified by:
        incrementToken in class org.apache.lucene.analysis.TokenStream
        Throws:
        java.io.IOException
      • end

        public void end()
                 throws java.io.IOException
        Overrides:
        end in class org.apache.lucene.analysis.TokenFilter
        Throws:
        java.io.IOException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class org.apache.lucene.util.AttributeSource
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class org.apache.lucene.util.AttributeSource