Package org.apache.lucene.analysis.ko
Class KoreanAnalyzer
- java.lang.Object
-
- org.apache.lucene.analysis.Analyzer
-
- org.apache.lucene.analysis.ko.KoreanAnalyzer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class KoreanAnalyzer extends Analyzer
Analyzer for Korean that uses morphological analysis.- Since:
- 7.4.0
- See Also:
KoreanTokenizer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
-
-
Field Summary
Fields Modifier and Type Field Description private KoreanTokenizer.DecompoundModemodeprivate booleanoutputUnknownUnigramsprivate java.util.Set<POS.Tag>stopTagsprivate UserDictionaryuserDict-
Fields inherited from class org.apache.lucene.analysis.Analyzer
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description KoreanAnalyzer()Creates a new KoreanAnalyzer.KoreanAnalyzer(UserDictionary userDict, KoreanTokenizer.DecompoundMode mode, java.util.Set<POS.Tag> stopTags, boolean outputUnknownUnigrams)Creates a new KoreanAnalyzer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Analyzer.TokenStreamComponentscreateComponents(java.lang.String fieldName)Creates a newAnalyzer.TokenStreamComponentsinstance for this analyzer.protected TokenStreamnormalize(java.lang.String fieldName, TokenStream in)Wrap the givenTokenStreamin order to apply normalization filters.-
Methods inherited from class org.apache.lucene.analysis.Analyzer
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, setVersion, tokenStream, tokenStream
-
-
-
-
Field Detail
-
userDict
private final UserDictionary userDict
-
mode
private final KoreanTokenizer.DecompoundMode mode
-
stopTags
private final java.util.Set<POS.Tag> stopTags
-
outputUnknownUnigrams
private final boolean outputUnknownUnigrams
-
-
Constructor Detail
-
KoreanAnalyzer
public KoreanAnalyzer()
Creates a new KoreanAnalyzer.
-
KoreanAnalyzer
public KoreanAnalyzer(UserDictionary userDict, KoreanTokenizer.DecompoundMode mode, java.util.Set<POS.Tag> stopTags, boolean outputUnknownUnigrams)
Creates a new KoreanAnalyzer.- Parameters:
userDict- Optional: if non-null, user dictionary.mode- Decompound mode.stopTags- The set of part of speech that should be filtered.outputUnknownUnigrams- If true outputs unigrams for unknown words.
-
-
Method Detail
-
createComponents
protected Analyzer.TokenStreamComponents createComponents(java.lang.String fieldName)
Description copied from class:AnalyzerCreates a newAnalyzer.TokenStreamComponentsinstance for this analyzer.- Specified by:
createComponentsin classAnalyzer- Parameters:
fieldName- the name of the fields content passed to theAnalyzer.TokenStreamComponentssink as a reader- Returns:
- the
Analyzer.TokenStreamComponentsfor this analyzer.
-
normalize
protected TokenStream normalize(java.lang.String fieldName, TokenStream in)
Description copied from class:AnalyzerWrap the givenTokenStreamin order to apply normalization filters. The default implementation returns theTokenStreamas-is. This is used byAnalyzer.normalize(String, String).
-
-