com.jalios.util.lucene
Class ApostropheFilter

java.lang.Object
  extended by org.apache.lucene.analysis.TokenStream
      extended by org.apache.lucene.analysis.TokenFilter
          extended by com.jalios.util.lucene.ApostropheFilter

public final class ApostropheFilter
extends org.apache.lucene.analysis.TokenFilter

Remove starting apostrophe from tokens extracted with StandardFilter. Used in french to remove first part of token such as:

  • "l'amour" to "amour"
  • "d'ailleurs" to "ailleurs"
  • "c'est" to "est"
  • "j'avais" to "avais"
  • "m'avait" to "avait"
  • "n'avez" to "avez"
  • "s'était" to "était"
  • "t'étais" to "étais"
  • Inspired from StandardFilter.

    Author:
    Olivier Jaquemet

    Field Summary
     
    Fields inherited from class org.apache.lucene.analysis.TokenFilter
    input
     
    Constructor Summary
    ApostropheFilter(org.apache.lucene.analysis.TokenStream in)
              Construct new ApostropheFilter filtering for specified stream.
     
    Method Summary
     org.apache.lucene.analysis.Token next()
              Returns the next token in the stream, or null at EOS.
     
    Methods inherited from class org.apache.lucene.analysis.TokenFilter
    close
     
    Methods inherited from class org.apache.lucene.analysis.TokenStream
    next, reset
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    ApostropheFilter

    public ApostropheFilter(org.apache.lucene.analysis.TokenStream in)
    Construct new ApostropheFilter filtering for specified stream.

    Parameters:
    in - the TokenStream to be filtered
    Method Detail

    next

    public org.apache.lucene.analysis.Token next()
                                          throws IOException
    Returns the next token in the stream, or null at EOS.

    Removes [cdjlmnstCDJLMNST]' from the start of words.

    Overrides:
    next in class org.apache.lucene.analysis.TokenStream
    Throws:
    IOException


    Copyright © 2001-2007 Jalios SA. All Rights Reserved.