public final class DutchAnalyzer extends ReusableAnalyzerBase
Analyzer
for Dutch language.
Supports an external list of stopwords (words that will not be indexed at all), an external list of exclusions (word that will not be stemmed, but indexed) and an external list of word-stem pairs that overrule the algorithm (dictionary stemming). A default set of stopwords is used unless an alternative list is specified, but the exclusion list is empty by default.
You must specify the required Version
compatibility when creating DutchAnalyzer:
DutchAnalyzer(Version, Set)
and
DutchAnalyzer(Version, Set, Set)
also populate
the default entries for the stem override dictionary
NOTE: This class uses the same Version
dependent settings as StandardAnalyzer
.
ReusableAnalyzerBase.TokenStreamComponents
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_STOPWORD_FILE
File containing default Dutch stopwords.
|
static String[] |
DUTCH_STOP_WORDS
Deprecated.
use
getDefaultStopSet() instead |
Constructor and Description |
---|
DutchAnalyzer(Version matchVersion)
Builds an analyzer with the default stop words (
getDefaultStopSet() )
and a few default entries for the stem exclusion table. |
DutchAnalyzer(Version matchVersion,
File stopwords)
Deprecated.
use
DutchAnalyzer(Version, Set) instead |
DutchAnalyzer(Version matchVersion,
HashSet<?> stopwords)
Deprecated.
use
DutchAnalyzer(Version, Set) instead |
DutchAnalyzer(Version matchVersion,
Set<?> stopwords) |
DutchAnalyzer(Version matchVersion,
Set<?> stopwords,
Set<?> stemExclusionTable) |
DutchAnalyzer(Version matchVersion,
Set<?> stopwords,
Set<?> stemExclusionTable,
CharArrayMap<String> stemOverrideDict) |
DutchAnalyzer(Version matchVersion,
String... stopwords)
Deprecated.
use
DutchAnalyzer(Version, Set) instead |
Modifier and Type | Method and Description |
---|---|
protected ReusableAnalyzerBase.TokenStreamComponents |
createComponents(String fieldName,
Reader aReader)
Returns a (possibly reused)
TokenStream which tokenizes all the
text in the provided Reader . |
static Set<?> |
getDefaultStopSet()
Returns an unmodifiable instance of the default stop-words set.
|
void |
setStemDictionary(File stemdictFile)
Deprecated.
This prevents reuse of TokenStreams. If you wish to use a custom
stem dictionary, create your own Analyzer with
StemmerOverrideFilter |
void |
setStemExclusionTable(File exclusionlist)
Deprecated.
use
DutchAnalyzer(Version, Set, Set) instead |
void |
setStemExclusionTable(HashSet<?> exclusionlist)
Deprecated.
use
DutchAnalyzer(Version, Set, Set) instead |
void |
setStemExclusionTable(String... exclusionlist)
Deprecated.
use
DutchAnalyzer(Version, Set, Set) instead |
initReader, reusableTokenStream, tokenStream
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setPreviousTokenStream
@Deprecated public static final String[] DUTCH_STOP_WORDS
getDefaultStopSet()
insteadpublic static final String DEFAULT_STOPWORD_FILE
public DutchAnalyzer(Version matchVersion)
getDefaultStopSet()
)
and a few default entries for the stem exclusion table.public DutchAnalyzer(Version matchVersion, Set<?> stopwords, Set<?> stemExclusionTable)
public DutchAnalyzer(Version matchVersion, Set<?> stopwords, Set<?> stemExclusionTable, CharArrayMap<String> stemOverrideDict)
@Deprecated public DutchAnalyzer(Version matchVersion, String... stopwords)
DutchAnalyzer(Version, Set)
insteadmatchVersion
- stopwords
- @Deprecated public DutchAnalyzer(Version matchVersion, HashSet<?> stopwords)
DutchAnalyzer(Version, Set)
insteadstopwords
- @Deprecated public DutchAnalyzer(Version matchVersion, File stopwords)
DutchAnalyzer(Version, Set)
insteadstopwords
- public static Set<?> getDefaultStopSet()
@Deprecated public void setStemExclusionTable(String... exclusionlist)
DutchAnalyzer(Version, Set, Set)
insteadexclusionlist
- @Deprecated public void setStemExclusionTable(HashSet<?> exclusionlist)
DutchAnalyzer(Version, Set, Set)
instead@Deprecated public void setStemExclusionTable(File exclusionlist)
DutchAnalyzer(Version, Set, Set)
instead@Deprecated public void setStemDictionary(File stemdictFile)
StemmerOverrideFilter
protected ReusableAnalyzerBase.TokenStreamComponents createComponents(String fieldName, Reader aReader)
TokenStream
which tokenizes all the
text in the provided Reader
.createComponents
in class ReusableAnalyzerBase
fieldName
- the name of the fields content passed to the
ReusableAnalyzerBase.TokenStreamComponents
sink as a readeraReader
- the reader passed to the Tokenizer
constructorTokenStream
built from a StandardTokenizer
filtered with StandardFilter
, LowerCaseFilter
,
StopFilter
, KeywordMarkerFilter
if a stem exclusion set is provided,
StemmerOverrideFilter
, and SnowballFilter