Class FilenameFilter

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class FilenameFilter
    extends org.apache.lucene.analysis.TokenFilter
    This filter tokenises filenames using .-_ as delimiters. It is needed because the StandardTokenizer does not work very well with filenames - it does not split on . unless followed by a space and does not split on _ if the next term begins with a number.
    • Nested Class Summary

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

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

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

        input
    • Constructor Summary

      Constructors 
      Constructor Description
      FilenameFilter​(org.apache.lucene.analysis.TokenStream tokenStream)  
      FilenameFilter​(org.apache.lucene.analysis.TokenStream tokenStream, String delimiters, boolean shouldIncrementPosition)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean incrementToken()  
      • Methods inherited from class org.apache.lucene.analysis.TokenFilter

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

        addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState
    • Constructor Detail

      • FilenameFilter

        public FilenameFilter​(org.apache.lucene.analysis.TokenStream tokenStream)
      • FilenameFilter

        public FilenameFilter​(org.apache.lucene.analysis.TokenStream tokenStream,
                              String delimiters,
                              boolean shouldIncrementPosition)
    • Method Detail

      • incrementToken

        public final boolean incrementToken()
                                     throws IOException
        Specified by:
        incrementToken in class org.apache.lucene.analysis.TokenStream
        Throws:
        IOException