Documentation of 'org.apache.lucene.analysis.standard.StandardAnalyzer' Java class
StandardAnalyzer
org.apache.lucene.analysis.standard

Class StandardAnalyzer

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int DEFAULT_MAX_TOKEN_LENGTH
      Default maximum allowed token length
      static java.lang.String[] STOP_WORDS
      An array containing some common English words that are usually not useful for searching.
    • Constructor Summary

      Constructors 
      Constructor and Description
      StandardAnalyzer()
      Builds an analyzer with the default stop words (STOP_WORDS).
      StandardAnalyzer(boolean replaceInvalidAcronym)
      Deprecated. 
      Remove in 3.X and make true the only valid value
      StandardAnalyzer(java.io.File stopwords)
      Builds an analyzer with the stop words from the given file.
      StandardAnalyzer(java.io.File stopwords, boolean replaceInvalidAcronym)
      Deprecated. 
      Remove in 3.X and make true the only valid value
      StandardAnalyzer(java.io.Reader stopwords)
      Builds an analyzer with the stop words from the given reader.
      StandardAnalyzer(java.io.Reader stopwords, boolean replaceInvalidAcronym)
      Deprecated. 
      Remove in 3.X and make true the only valid value
      StandardAnalyzer(java.util.Set stopWords)
      Builds an analyzer with the given stop words.
      StandardAnalyzer(java.util.Set stopwords, boolean replaceInvalidAcronym)
      Deprecated. 
      Remove in 3.X and make true the only valid value
      StandardAnalyzer(java.lang.String[] stopWords)
      Builds an analyzer with the given stop words.
      StandardAnalyzer(java.lang.String[] stopwords, boolean replaceInvalidAcronym)
      Deprecated. 
      Remove in 3.X and make true the only valid value
    • Field Detail

      • STOP_WORDS

        public static final java.lang.String[] STOP_WORDS
        An array containing some common English words that are usually not useful for searching.
      • DEFAULT_MAX_TOKEN_LENGTH

        public static final int DEFAULT_MAX_TOKEN_LENGTH
        Default maximum allowed token length
        See Also:
        Constant Field Values
    • Constructor Detail

      • StandardAnalyzer

        public StandardAnalyzer()
        Builds an analyzer with the default stop words (STOP_WORDS).
      • StandardAnalyzer

        public StandardAnalyzer(java.util.Set stopWords)
        Builds an analyzer with the given stop words.
      • StandardAnalyzer

        public StandardAnalyzer(java.lang.String[] stopWords)
        Builds an analyzer with the given stop words.
      • StandardAnalyzer

        public StandardAnalyzer(java.io.File stopwords)
                         throws java.io.IOException
        Builds an analyzer with the stop words from the given file.
        Throws:
        java.io.IOException
        See Also:
        WordlistLoader.getWordSet(File)
      • StandardAnalyzer

        public StandardAnalyzer(java.io.Reader stopwords)
                         throws java.io.IOException
        Builds an analyzer with the stop words from the given reader.
        Throws:
        java.io.IOException
        See Also:
        WordlistLoader.getWordSet(Reader)
      • StandardAnalyzer

        public StandardAnalyzer(boolean replaceInvalidAcronym)
        Deprecated. Remove in 3.X and make true the only valid value
        Parameters:
        replaceInvalidAcronym - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer See https://issues.apache.org/jira/browse/LUCENE-1068
      • StandardAnalyzer

        public StandardAnalyzer(java.io.Reader stopwords,
                                boolean replaceInvalidAcronym)
                         throws java.io.IOException
        Deprecated. Remove in 3.X and make true the only valid value
        Parameters:
        stopwords - The stopwords to use
        replaceInvalidAcronym - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer See https://issues.apache.org/jira/browse/LUCENE-1068
        Throws:
        java.io.IOException
      • StandardAnalyzer

        public StandardAnalyzer(java.io.File stopwords,
                                boolean replaceInvalidAcronym)
                         throws java.io.IOException
        Deprecated. Remove in 3.X and make true the only valid value
        Parameters:
        stopwords - The stopwords to use
        replaceInvalidAcronym - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer See https://issues.apache.org/jira/browse/LUCENE-1068
        Throws:
        java.io.IOException
      • StandardAnalyzer

        public StandardAnalyzer(java.lang.String[] stopwords,
                                boolean replaceInvalidAcronym)
                         throws java.io.IOException
        Deprecated. Remove in 3.X and make true the only valid value
        Parameters:
        stopwords - The stopwords to use
        replaceInvalidAcronym - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer See https://issues.apache.org/jira/browse/LUCENE-1068
        Throws:
        java.io.IOException
      • StandardAnalyzer

        public StandardAnalyzer(java.util.Set stopwords,
                                boolean replaceInvalidAcronym)
                         throws java.io.IOException
        Deprecated. Remove in 3.X and make true the only valid value
        Parameters:
        stopwords - The stopwords to use
        replaceInvalidAcronym - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer See https://issues.apache.org/jira/browse/LUCENE-1068
        Throws:
        java.io.IOException
    • Method Detail

      • setMaxTokenLength

        public void setMaxTokenLength(int length)
        Set maximum allowed token length. If a token is seen that exceeds this length then it is discarded. This setting only takes effect the next time tokenStream or reusableTokenStream is called.
      • reusableTokenStream

        public TokenStream reusableTokenStream(java.lang.String fieldName,
                                               java.io.Reader reader)
                                        throws java.io.IOException
        Description copied from class: Analyzer
        Creates a TokenStream that is allowed to be re-used from the previous time that the same thread called this method. Callers that do not need to use more than one TokenStream at the same time from this analyzer should use this method for better performance.
        Overrides:
        reusableTokenStream in class Analyzer
        Throws:
        java.io.IOException
      • isReplaceInvalidAcronym

        public boolean isReplaceInvalidAcronym()
        Returns:
        true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer See https://issues.apache.org/jira/browse/LUCENE-1068
      • setReplaceInvalidAcronym

        public void setReplaceInvalidAcronym(boolean replaceInvalidAcronym)
        Parameters:
        replaceInvalidAcronym - Set to true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer See https://issues.apache.org/jira/browse/LUCENE-1068

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.