public abstract class StopwordAnalyzerBase extends Analyzer
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents| Modifier and Type | Field and Description |
|---|---|
protected CharArraySet |
stopwords
An immutable stopword set
|
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY| Modifier | Constructor and Description |
|---|---|
protected |
StopwordAnalyzerBase()
Creates a new Analyzer with an empty stopword set
|
protected |
StopwordAnalyzerBase(CharArraySet stopwords)
Creates a new instance initialized with the given stopword set
|
| Modifier and Type | Method and Description |
|---|---|
CharArraySet |
getStopwordSet()
Returns the analyzer's stopword set or an empty set if the analyzer has no
stopwords
|
protected static CharArraySet |
loadStopwordSet(boolean ignoreCase,
java.lang.Class<? extends Analyzer> aClass,
java.lang.String resource,
java.lang.String comment)
Creates a CharArraySet from a file resource associated with a class.
|
protected static CharArraySet |
loadStopwordSet(java.nio.file.Path stopwords)
Creates a CharArraySet from a path.
|
protected static CharArraySet |
loadStopwordSet(java.io.Reader stopwords)
Creates a CharArraySet from a file.
|
attributeFactory, close, createComponents, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, normalize, setVersion, tokenStream, tokenStreamprotected final CharArraySet stopwords
protected StopwordAnalyzerBase(CharArraySet stopwords)
stopwords - the analyzer's stopword setprotected StopwordAnalyzerBase()
public CharArraySet getStopwordSet()
protected static CharArraySet loadStopwordSet(boolean ignoreCase, java.lang.Class<? extends Analyzer> aClass, java.lang.String resource, java.lang.String comment) throws java.io.IOException
Class.getResourceAsStream(String)).ignoreCase - true if the set should ignore the case of the
stopwords, otherwise falseaClass - a class that is associated with the given stopwordResourceresource - name of the resource file associated with the given classcomment - comment string to ignore in the stopword filejava.io.IOException - if loading the stopwords throws an IOExceptionprotected static CharArraySet loadStopwordSet(java.nio.file.Path stopwords) throws java.io.IOException
stopwords - the stopwords file to loadjava.io.IOException - if loading the stopwords throws an IOExceptionprotected static CharArraySet loadStopwordSet(java.io.Reader stopwords) throws java.io.IOException
stopwords - the stopwords reader to loadjava.io.IOException - if loading the stopwords throws an IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.