org.apache.lucene.analysis.cjk
Class CJKAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.ReusableAnalyzerBase
org.apache.lucene.analysis.StopwordAnalyzerBase
org.apache.lucene.analysis.cjk.CJKAnalyzer
- All Implemented Interfaces:
- Closeable
public final class CJKAnalyzer
- extends StopwordAnalyzerBase
An 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STOP_WORDS
@Deprecated
public static final String[] STOP_WORDS
- Deprecated. use
getDefaultStopSet()
instead- An array containing some common English words that are not usually
useful for searching and some double-byte interpunctions.
CJKAnalyzer
public CJKAnalyzer(Version matchVersion)
- Builds an analyzer which removes words in
getDefaultStopSet()
.
CJKAnalyzer
public CJKAnalyzer(Version matchVersion,
Set<?> stopwords)
- Builds an analyzer with the given stop words
- Parameters:
matchVersion
- lucene compatibility versionstopwords
- a stopword set
CJKAnalyzer
@Deprecated
public CJKAnalyzer(Version matchVersion,
String... stopWords)
- Deprecated. use
CJKAnalyzer(Version, Set)
instead
- Builds an analyzer which removes words in the provided array.
- Parameters:
stopWords
- stop word array
getDefaultStopSet
public static Set<?> getDefaultStopSet()
- Returns an unmodifiable instance of the default stop-words set.
- Returns:
- an unmodifiable instance of the default stop-words set.
createComponents
protected ReusableAnalyzerBase.TokenStreamComponents createComponents(String fieldName,
Reader reader)
- Description copied from class:
ReusableAnalyzerBase
- Creates a new
ReusableAnalyzerBase.TokenStreamComponents
instance for this analyzer.
- Specified by:
createComponents
in class ReusableAnalyzerBase
- Parameters:
fieldName
- the name of the fields content passed to the
ReusableAnalyzerBase.TokenStreamComponents
sink as a readerreader
- the reader passed to the Tokenizer
constructor
- Returns:
- the
ReusableAnalyzerBase.TokenStreamComponents
for this analyzer.