Class EasyDeskAnalyzer

java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.StopwordAnalyzerBase
com.easydesk.lucene.analyzer.EasyDeskAnalyzer
All Implemented Interfaces:
Closeable, AutoCloseable

public final class EasyDeskAnalyzer extends org.apache.lucene.analysis.StopwordAnalyzerBase
EasyDeskTokenizer 를 EasyDeskFilter, LowerCaseFilter, StopFilter (영어 불용어) 로 처리한다.
  • Nested Class Summary

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

    org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default maximum allowed token length
    static final org.apache.lucene.analysis.CharArraySet
    An unmodifiable set containing some common English words that are usually not useful for searching.

    Fields inherited from class org.apache.lucene.analysis.StopwordAnalyzerBase

    stopwords

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

    GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Builds an analyzer with the default stop words (STOP_WORDS_SET).
    Builds an analyzer with the stop words from the given reader.
    EasyDeskAnalyzer(org.apache.lucene.analysis.CharArraySet stopWords)
    Builds an analyzer with the given stop words.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents
     
    int
     
    protected org.apache.lucene.analysis.TokenStream
    normalize(String fieldName, org.apache.lucene.analysis.TokenStream in)
     
    void
    setMaxTokenLength(int length)
    Set maximum allowed token length.
    void
     

    Methods inherited from class org.apache.lucene.analysis.StopwordAnalyzerBase

    getStopwordSet, loadStopwordSet, loadStopwordSet

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

    attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, initReader, initReaderForNormalization, normalize, tokenStream, tokenStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_MAX_TOKEN_LENGTH

      public static final int DEFAULT_MAX_TOKEN_LENGTH
      Default maximum allowed token length
      See Also:
    • STOP_WORDS_SET

      public static final org.apache.lucene.analysis.CharArraySet STOP_WORDS_SET
      An unmodifiable set containing some common English words that are usually not useful for searching.
  • Constructor Details

    • EasyDeskAnalyzer

      public EasyDeskAnalyzer()
      Builds an analyzer with the default stop words (STOP_WORDS_SET).
    • EasyDeskAnalyzer

      public EasyDeskAnalyzer(org.apache.lucene.analysis.CharArraySet stopWords)
      Builds an analyzer with the given stop words.
      Parameters:
      stopWords - stop words
    • EasyDeskAnalyzer

      public EasyDeskAnalyzer(Reader stopwords) throws IOException
      Builds an analyzer with the stop words from the given reader.
      Parameters:
      stopwords - Reader to read stop words from
      Throws:
      IOException - read error
  • Method Details

    • 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 is called.
      Parameters:
      length - max token length
    • getMaxTokenLength

      public int getMaxTokenLength()
      Returns:
      max token length
      See Also:
    • setMorphologyAnalyzer

      public void setMorphologyAnalyzer(MorphologyAnalyzer morphologyAnalyzer)
      Parameters:
      morphologyAnalyzer - 한글 형태소 분석기
    • createComponents

      protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName)
      Specified by:
      createComponents in class org.apache.lucene.analysis.Analyzer
    • normalize

      protected org.apache.lucene.analysis.TokenStream normalize(String fieldName, org.apache.lucene.analysis.TokenStream in)
      Overrides:
      normalize in class org.apache.lucene.analysis.Analyzer