org.apache.solr.analysis

## Class TokenizerChain

- java.lang.Object
- - org.apache.lucene.analysis.Analyzer
  - - org.apache.solr.analysis.SolrAnalyzer
    - - org.apache.solr.analysis.TokenizerChain

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public final class TokenizerChain
      extends SolrAnalyzer

  An analyzer that uses a tokenizer and a list of token filters to create a TokenStream.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer

      `Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.analysis.Analyzer

      `GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenizerChain(CharFilterFactory[] charFilters, TokenizerFactory tokenizer, TokenFilterFactory[] filters)` Creates a new TokenizerChain.
    `TokenizerChain(TokenizerFactory tokenizer, TokenFilterFactory[] filters)` Creates a new TokenizerChain w/o any CharFilterFactories.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Analyzer.TokenStreamComponents` | `createComponents(String fieldName)`
    `CharFilterFactory[]` | `getCharFilterFactories()`
    `TokenFilterFactory[]` | `getTokenFilterFactories()`
    `TokenizerFactory` | `getTokenizerFactory()`
    `Reader` | `initReader(String fieldName, Reader reader)`
    `protected Reader` | `initReaderForNormalization(String fieldName, Reader reader)`
    `protected TokenStream` | `normalize(String fieldName, TokenStream in)`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.solr.analysis.SolrAnalyzer

      `getPositionIncrementGap, setPositionIncrementGap`

    - ### Methods inherited from class org.apache.lucene.analysis.Analyzer

      `attributeFactory, close, getOffsetGap, getReuseStrategy, getVersion, normalize, setVersion, tokenStream, tokenStream`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TokenizerChain

          public TokenizerChain(TokenizerFactory tokenizer,
                                TokenFilterFactory[] filters)

      Creates a new TokenizerChain w/o any CharFilterFactories.
      Parameters:
        `tokenizer` - Factory for the Tokenizer to use, must not be null.
        `filters` - Factories for the TokenFilters to use - if null, will be treated as if empty.

    - #### TokenizerChain

          public TokenizerChain(CharFilterFactory[] charFilters,
                                TokenizerFactory tokenizer,
                                TokenFilterFactory[] filters)

      Creates a new TokenizerChain.
      Parameters:
        `charFilters` - Factories for the CharFilters to use, if any - if null, will be treated as if empty.
        `tokenizer` - Factory for the Tokenizer to use, must not be null.
        `filters` - Factories for the TokenFilters to use if any- if null, will be treated as if empty.

  - ### Method Detail

    - #### getCharFilterFactories

          public CharFilterFactory[] getCharFilterFactories()

      Returns:
        array of CharFilterFactories, may be empty but never null

    - #### getTokenizerFactory

          public TokenizerFactory getTokenizerFactory()

      Returns:
        the TokenizerFactory in use, will never be null

    - #### getTokenFilterFactories

          public TokenFilterFactory[] getTokenFilterFactories()

      Returns:
        array of TokenFilterFactories, may be empty but never null

    - #### initReader

          public Reader initReader(String fieldName,
                                   Reader reader)

      Overrides:
        `initReader` in class `SolrAnalyzer`

    - #### initReaderForNormalization

          protected Reader initReaderForNormalization(String fieldName,
                                                      Reader reader)

      Overrides:
        `initReaderForNormalization` in class `Analyzer`

    - #### createComponents

          protected Analyzer.TokenStreamComponents createComponents(String fieldName)

      Specified by:
        `createComponents` in class `Analyzer`

    - #### normalize

          protected TokenStream normalize(String fieldName,
                                          TokenStream in)

      Overrides:
        `normalize` in class `Analyzer`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.