public class SpellWritingAnalyzer
extends Analyzer
StandardAnalyzer
, which performs
all the same functions plus queues words to a spelling dictionary.Modifier and Type | Field and Description |
---|---|
static String[] |
STOP_WORDS
An array containing some common English words that are usually not useful
for searching.
|
private Set |
stopSet
Set of stop words to remove during analysis
|
private SpellWriter |
writer
Destination for words to be added to dictionary
|
Constructor and Description |
---|
SpellWritingAnalyzer(File stopwords,
SpellWriter spellWriter)
Builds an analyzer which writes to the given spelling dictionary, using the
stop words from the given file.
|
SpellWritingAnalyzer(Reader stopwords,
SpellWriter spellWriter)
Builds an analyzer which writes to the given spelling dictionary, using the
stop words from the given reader.
|
SpellWritingAnalyzer(Set stopWords,
SpellWriter spellWriter)
Builds an analyzer which writes to the given spelling dictionary, using the
given stop words.
|
SpellWritingAnalyzer(SpellWriter spellWriter)
Builds an analyzer which writes to the given spelling dictionary, with the
default stop words (
STOP_WORDS ). |
SpellWritingAnalyzer(String[] stopWords,
SpellWriter spellWriter)
Builds an analyzer which writes to the given spelling dictionary, using the
given stop words.
|
Modifier and Type | Method and Description |
---|---|
TokenStream |
tokenStream(String fieldName,
Reader reader)
Constructs a
StandardTokenizer filtered by a StandardFilter , a SpellWritingFilter , a LowerCaseFilter
and a StopFilter . |
private Set stopSet
private SpellWriter writer
public static final String[] STOP_WORDS
public SpellWritingAnalyzer(SpellWriter spellWriter)
STOP_WORDS
).public SpellWritingAnalyzer(Set stopWords, SpellWriter spellWriter)
public SpellWritingAnalyzer(String[] stopWords, SpellWriter spellWriter)
public SpellWritingAnalyzer(File stopwords, SpellWriter spellWriter) throws IOException
IOException
WordlistLoader.getWordSet(File)
public SpellWritingAnalyzer(Reader stopwords, SpellWriter spellWriter) throws IOException
IOException
WordlistLoader.getWordSet(Reader)
public TokenStream tokenStream(String fieldName, Reader reader)
StandardTokenizer
filtered by a StandardFilter
, a SpellWritingFilter
, a LowerCaseFilter
and a StopFilter
.tokenStream
in class Analyzer