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.
|
matchVersion, stopwords| Constructor and Description |
|---|
PersianAnalyzer(Version matchVersion)
Builds an analyzer with the default stop words:
DEFAULT_STOPWORD_FILE. |
PersianAnalyzer(Version matchVersion,
CharArraySet stopwords)
Builds an analyzer with the given stop words
|
| 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, loadStopwordSetclose, getOffsetGap, getPositionIncrementGap, tokenStreampublic static final String DEFAULT_STOPWORD_FILE
public static final String STOPWORDS_COMMENT
public PersianAnalyzer(Version matchVersion)
DEFAULT_STOPWORD_FILE.public PersianAnalyzer(Version matchVersion, CharArraySet stopwords)
matchVersion - lucene compatibility versionstopwords - a stopword setpublic 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 AnalyzerAnalyzer.TokenStreamComponents
built from a StandardTokenizer filtered with
LowerCaseFilter, ArabicNormalizationFilter,
PersianNormalizationFilter and Persian Stop wordsprotected Reader initReader(String fieldName, Reader reader)
PersianCharFilterinitReader in class AnalyzerCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.