public final class CJKAnalyzer extends StopwordAnalyzerBase
Analyzer
that tokenizes text with StandardTokenizer
,
normalizes content with CJKWidthFilter
, folds case with
LowerCaseFilter
, forms bigrams of CJK with CJKBigramFilter
,
and filters stopwords with StopFilter
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_STOPWORD_FILE
File containing default CJK stopwords.
|
stopwords
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
Constructor and Description |
---|
CJKAnalyzer()
Builds an analyzer which removes words in
getDefaultStopSet() . |
CJKAnalyzer(CharArraySet stopwords)
Builds an analyzer with the given stop words
|
Modifier and Type | Method and Description |
---|---|
protected Analyzer.TokenStreamComponents |
createComponents(String fieldName)
Creates a new
Analyzer.TokenStreamComponents instance for this analyzer. |
static CharArraySet |
getDefaultStopSet()
Returns an unmodifiable instance of the default stop-words set.
|
protected TokenStream |
normalize(String fieldName,
TokenStream in)
Wrap the given
TokenStream in order to apply normalization filters. |
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, setVersion, tokenStream, tokenStream
public static final String DEFAULT_STOPWORD_FILE
Currently it contains some common English words that are not usually useful for searching and some double-byte interpunctions.
public CJKAnalyzer()
getDefaultStopSet()
.public CJKAnalyzer(CharArraySet stopwords)
stopwords
- a stopword setpublic static CharArraySet getDefaultStopSet()
protected Analyzer.TokenStreamComponents createComponents(String fieldName)
Analyzer
Analyzer.TokenStreamComponents
instance for this analyzer.createComponents
in class Analyzer
fieldName
- the name of the fields content passed to the
Analyzer.TokenStreamComponents
sink as a readerAnalyzer.TokenStreamComponents
for this analyzer.protected TokenStream normalize(String fieldName, TokenStream in)
Analyzer
TokenStream
in order to apply normalization filters.
The default implementation returns the TokenStream
as-is. This is
used by Analyzer.normalize(String, String)
.