Class MLTokenDuplicator

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class MLTokenDuplicator
    extends org.apache.lucene.analysis.TokenStream
    Create duplicate tokens for multilingual varients The forms are Tokens: Token - all languages {fr}Token - if a language is specified {fr_CA}Token - if a language and country is specified {fr_CA_Varient}Token - for all three {fr__Varient}Token - for a language varient with no country
    Author:
    andyh
    • 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.TokenStream

        DEFAULT_TOKEN_ATTRIBUTE_FACTORY
    • Constructor Summary

      Constructors 
      Constructor Description
      MLTokenDuplicator​(Locale locale, org.alfresco.repo.search.MLAnalysisMode mlAnalysisMode)  
      MLTokenDuplicator​(org.apache.lucene.analysis.TokenStream source, Locale locale, Reader reader, org.alfresco.repo.search.MLAnalysisMode mlAnalysisMode)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Iterator<org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl> buildIterator​(org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl token)  
      void close()  
      void end()  
      boolean incrementToken()  
      void reset()  
      • Methods inherited from class org.apache.lucene.util.AttributeSource

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

      • MLTokenDuplicator

        public MLTokenDuplicator​(org.apache.lucene.analysis.TokenStream source,
                                 Locale locale,
                                 Reader reader,
                                 org.alfresco.repo.search.MLAnalysisMode mlAnalysisMode)
      • MLTokenDuplicator

        public MLTokenDuplicator​(Locale locale,
                                 org.alfresco.repo.search.MLAnalysisMode mlAnalysisMode)
        Parameters:
        locale -
        mlAnalysisMode -
    • Method Detail

      • reset

        public void reset()
                   throws IOException
        Overrides:
        reset in class org.apache.lucene.analysis.TokenStream
        Throws:
        IOException
      • end

        public void end()
                 throws IOException
        Overrides:
        end in class org.apache.lucene.analysis.TokenStream
        Throws:
        IOException
      • buildIterator

        public Iterator<org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl> buildIterator​(org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl token)
      • incrementToken

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