public final class PersianAnalyzer extends StopwordAnalyzerBase
Analyzer
for Persian.
This Analyzer uses PersianCharFilter
which implies tokenizing around
zero-width non-joiner in addition to whitespace. Some persian-specific variant forms (such as farsi
yeh and keheh) are standardized. "Stemming" is accomplished via stopwords.
Analyzer.GlobalReuseStrategy, Analyzer.PerFieldReuseStrategy, Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_STOPWORD_FILE
File containing default Persian stopwords.
|
static String |
STOPWORDS_COMMENT
The comment character in the stopwords file.
|
stopwords
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
Constructor and Description |
---|
PersianAnalyzer()
Builds an analyzer with the default stop words:
DEFAULT_STOPWORD_FILE . |
PersianAnalyzer(CharArraySet stopwords)
Builds an analyzer with the given stop words
|
PersianAnalyzer(Version matchVersion)
Deprecated.
|
PersianAnalyzer(Version matchVersion,
CharArraySet stopwords)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected Analyzer.TokenStreamComponents |
createComponents(String fieldName,
Reader reader)
Creates
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader . |
static CharArraySet |
getDefaultStopSet()
Returns an unmodifiable instance of the default stop-words set.
|
protected Reader |
initReader(String fieldName,
Reader reader)
Wraps the Reader with
PersianCharFilter |
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet
close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, setVersion, tokenStream, tokenStream
public static final String DEFAULT_STOPWORD_FILE
public static final String STOPWORDS_COMMENT
public PersianAnalyzer()
DEFAULT_STOPWORD_FILE
.@Deprecated public PersianAnalyzer(Version matchVersion)
PersianAnalyzer()
public PersianAnalyzer(CharArraySet stopwords)
stopwords
- a stopword set@Deprecated public PersianAnalyzer(Version matchVersion, CharArraySet stopwords)
PersianAnalyzer(CharArraySet)
public static CharArraySet getDefaultStopSet()
protected Analyzer.TokenStreamComponents createComponents(String fieldName, Reader reader)
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader
.createComponents
in class Analyzer
Analyzer.TokenStreamComponents
built from a StandardTokenizer
filtered with
LowerCaseFilter
, ArabicNormalizationFilter
,
PersianNormalizationFilter
and Persian Stop wordsprotected Reader initReader(String fieldName, Reader reader)
PersianCharFilter
initReader
in class Analyzer
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.