Package com.easydesk.lucene.analyzer
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
-
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
FieldsModifier and TypeFieldDescriptionstatic final intDefault maximum allowed token lengthstatic final org.apache.lucene.analysis.CharArraySetAn unmodifiable set containing some common English words that are usually not useful for searching.Fields inherited from class org.apache.lucene.analysis.StopwordAnalyzerBase
stopwordsFields inherited from class org.apache.lucene.analysis.Analyzer
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY -
Constructor Summary
ConstructorsConstructorDescriptionBuilds an analyzer with the default stop words (STOP_WORDS_SET).EasyDeskAnalyzer(Reader stopwords) 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 TypeMethodDescriptionprotected org.apache.lucene.analysis.Analyzer.TokenStreamComponentscreateComponents(String fieldName) intprotected org.apache.lucene.analysis.TokenStreamvoidsetMaxTokenLength(int length) Set maximum allowed token length.voidsetMorphologyAnalyzer(MorphologyAnalyzer morphologyAnalyzer) Methods inherited from class org.apache.lucene.analysis.StopwordAnalyzerBase
getStopwordSet, loadStopwordSet, loadStopwordSetMethods inherited from class org.apache.lucene.analysis.Analyzer
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, initReader, initReaderForNormalization, normalize, tokenStream, tokenStream
-
Field Details
-
DEFAULT_MAX_TOKEN_LENGTH
public static final int DEFAULT_MAX_TOKEN_LENGTHDefault maximum allowed token length- See Also:
-
STOP_WORDS_SET
public static final org.apache.lucene.analysis.CharArraySet STOP_WORDS_SETAn 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
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
- Parameters:
morphologyAnalyzer- 한글 형태소 분석기
-
createComponents
protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName) - Specified by:
createComponentsin classorg.apache.lucene.analysis.Analyzer
-
normalize
protected org.apache.lucene.analysis.TokenStream normalize(String fieldName, org.apache.lucene.analysis.TokenStream in) - Overrides:
normalizein classorg.apache.lucene.analysis.Analyzer
-