org.apache.lucene.analysis.br

## Class BrazilianAnalyzer

- java.lang.Object
- - org.apache.lucene.analysis.Analyzer
  - - org.apache.lucene.analysis.br.BrazilianAnalyzer

-     public final class BrazilianAnalyzer
      extends org.apache.lucene.analysis.Analyzer

  `Analyzer` for Brazilian Portuguese language.

  Supports an external list of stopwords (words that will not be indexed at all) and an external list of exclusions (words that will not be stemmed, but indexed).

  NOTE: This class uses the same `Version` dependent settings as `StandardAnalyzer`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String[]` | `BRAZILIAN_STOP_WORDS` List of typical Brazilian Portuguese stopwords.

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

      `overridesTokenStreamMethod`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BrazilianAnalyzer()` Deprecated. Use `BrazilianAnalyzer(Version)` instead
    `BrazilianAnalyzer(java.io.File stopwords)` Deprecated. Use `BrazilianAnalyzer(Version, File)` instead
    `BrazilianAnalyzer(java.util.Map stopwords)` Deprecated. Use `BrazilianAnalyzer(Version, Map)` instead
    `BrazilianAnalyzer(java.lang.String[] stopwords)` Deprecated. Use `BrazilianAnalyzer(Version, String[])` instead
    `BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion)` Builds an analyzer with the default stop words (`BRAZILIAN_STOP_WORDS`).
    `BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, java.io.File stopwords)` Builds an analyzer with the given stop words.
    `BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, java.util.Map stopwords)` Builds an analyzer with the given stop words.
    `BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, java.lang.String[] stopwords)` Builds an analyzer with the given stop words.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.lucene.analysis.TokenStream` | `reusableTokenStream(java.lang.String fieldName, java.io.Reader reader)` Returns a (possibly reused) `TokenStream` which tokenizes all the text in the provided `Reader`.
    `void` | `setStemExclusionTable(java.io.File exclusionlist)` Builds an exclusionlist from the words contained in the given file.
    `void` | `setStemExclusionTable(java.util.Map exclusionlist)` Builds an exclusionlist from a `Map`.
    `void` | `setStemExclusionTable(java.lang.String[] exclusionlist)` Builds an exclusionlist from an array of Strings.
    `org.apache.lucene.analysis.TokenStream` | `tokenStream(java.lang.String fieldName, java.io.Reader reader)` Creates a `TokenStream` which tokenizes all the text in the provided `Reader`.

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

      `close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setOverridesTokenStreamMethod, setPreviousTokenStream`

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

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

- - ### Field Detail

    - #### BRAZILIAN_STOP_WORDS

          public static final java.lang.String[] BRAZILIAN_STOP_WORDS

      List of typical Brazilian Portuguese stopwords.

  - ### Constructor Detail

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer()

      Deprecated. Use `BrazilianAnalyzer(Version)` instead
      Builds an analyzer with the default stop words (`BRAZILIAN_STOP_WORDS`).

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion)

      Builds an analyzer with the default stop words (`BRAZILIAN_STOP_WORDS`).

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer(java.lang.String[] stopwords)

      Deprecated. Use `BrazilianAnalyzer(Version, String[])` instead
      Builds an analyzer with the given stop words.

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                                   java.lang.String[] stopwords)

      Builds an analyzer with the given stop words.

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer(java.util.Map stopwords)

      Deprecated. Use `BrazilianAnalyzer(Version, Map)` instead
      Builds an analyzer with the given stop words.

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                                   java.util.Map stopwords)

      Builds an analyzer with the given stop words.

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer(java.io.File stopwords)
                            throws java.io.IOException

      Deprecated. Use `BrazilianAnalyzer(Version, File)` instead
      Builds an analyzer with the given stop words.
      Throws:
        `java.io.IOException`

    - #### BrazilianAnalyzer

          public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                                   java.io.File stopwords)
                            throws java.io.IOException

      Builds an analyzer with the given stop words.
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### setStemExclusionTable

          public void setStemExclusionTable(java.lang.String[] exclusionlist)

      Builds an exclusionlist from an array of Strings.

    - #### setStemExclusionTable

          public void setStemExclusionTable(java.util.Map exclusionlist)

      Builds an exclusionlist from a `Map`.

    - #### setStemExclusionTable

          public void setStemExclusionTable(java.io.File exclusionlist)
                                     throws java.io.IOException

      Builds an exclusionlist from the words contained in the given file.
      Throws:
        `java.io.IOException`

    - #### tokenStream

          public final org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName,
                                                                          java.io.Reader reader)

      Creates a `TokenStream` which tokenizes all the text in the provided `Reader`.
      Specified by:
        `tokenStream` in class `org.apache.lucene.analysis.Analyzer`
      Returns:
        A `TokenStream` built from a `StandardTokenizer` filtered with `LowerCaseFilter`, `StandardFilter`, `StopFilter`, and `BrazilianStemFilter`.

    - #### reusableTokenStream

          public org.apache.lucene.analysis.TokenStream reusableTokenStream(java.lang.String fieldName,
                                                                            java.io.Reader reader)
                                                                     throws java.io.IOException

      Returns a (possibly reused) `TokenStream` which tokenizes all the text in the provided `Reader`.
      Overrides:
        `reusableTokenStream` in class `org.apache.lucene.analysis.Analyzer`
      Returns:
        A `TokenStream` built from a `StandardTokenizer` filtered with `LowerCaseFilter`, `StandardFilter`, `StopFilter`, and `BrazilianStemFilter`.
      Throws:
        `java.io.IOException`

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