public final class StopFilter extends FilteringTokenFilter
You must specify the required Version
compatibility when creating StopFilter:
AttributeSource.AttributeFactory, AttributeSource.State
input
Constructor and Description |
---|
StopFilter(boolean enablePositionIncrements,
TokenStream in,
Set<?> stopWords)
Deprecated.
use
StopFilter(Version, TokenStream, Set) instead |
StopFilter(boolean enablePositionIncrements,
TokenStream input,
Set<?> stopWords,
boolean ignoreCase)
Deprecated.
Use
StopFilter(Version, TokenStream, Set) instead |
StopFilter(Version matchVersion,
TokenStream in,
Set<?> stopWords)
Constructs a filter which removes words from the input TokenStream that are
named in the Set.
|
StopFilter(Version matchVersion,
TokenStream input,
Set<?> stopWords,
boolean ignoreCase)
Deprecated.
Use
StopFilter(Version, TokenStream, Set) instead |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept()
Returns the next input Token whose term() is not a stop word.
|
static boolean |
getEnablePositionIncrementsVersionDefault(Version matchVersion)
Deprecated.
use
StopFilter(Version, TokenStream, Set) instead |
static Set<Object> |
makeStopSet(List<?> stopWords)
Deprecated.
use
makeStopSet(Version, List) instead |
static Set<Object> |
makeStopSet(List<?> stopWords,
boolean ignoreCase)
Deprecated.
use
makeStopSet(Version, List, boolean) instead |
static Set<Object> |
makeStopSet(String... stopWords)
Deprecated.
use
makeStopSet(Version, String...) instead |
static Set<Object> |
makeStopSet(String[] stopWords,
boolean ignoreCase)
Deprecated.
use
makeStopSet(Version, String[], boolean) instead; |
static Set<Object> |
makeStopSet(Version matchVersion,
List<?> stopWords)
Builds a Set from an array of stop words,
appropriate for passing into the StopFilter constructor.
|
static Set<Object> |
makeStopSet(Version matchVersion,
List<?> stopWords,
boolean ignoreCase)
Creates a stopword set from the given stopword list.
|
static Set<Object> |
makeStopSet(Version matchVersion,
String... stopWords)
Builds a Set from an array of stop words,
appropriate for passing into the StopFilter constructor.
|
static Set<Object> |
makeStopSet(Version matchVersion,
String[] stopWords,
boolean ignoreCase)
Creates a stopword set from the given stopword array.
|
getEnablePositionIncrements, incrementToken, reset, setEnablePositionIncrements
close, end
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
@Deprecated public StopFilter(boolean enablePositionIncrements, TokenStream input, Set<?> stopWords, boolean ignoreCase)
StopFilter(Version, TokenStream, Set)
insteadstopWords
is an instance of CharArraySet
(true if
makeStopSet()
was used to construct the set) it will be directly used
and ignoreCase
will be ignored since CharArraySet
directly controls case sensitivity.
If stopWords
is not an instance of CharArraySet
,
a new CharArraySet will be constructed and ignoreCase
will be
used to specify the case sensitivity of that set.enablePositionIncrements
- true if token positions should record the removed stop wordsinput
- Input TokenStreamstopWords
- A Set of Strings or char[] or any other toString()-able set representing the stopwordsignoreCase
- if true, all words are lower cased first@Deprecated public StopFilter(Version matchVersion, TokenStream input, Set<?> stopWords, boolean ignoreCase)
StopFilter(Version, TokenStream, Set)
insteadstopWords
is an instance of CharArraySet
(true if
makeStopSet()
was used to construct the set) it will be
directly used and ignoreCase
will be ignored since
CharArraySet
directly controls case sensitivity.
If stopWords
is not an instance of CharArraySet
, a new
CharArraySet will be constructed and ignoreCase
will be used
to specify the case sensitivity of that set.matchVersion
- Lucene version to enable correct Unicode 4.0 behavior in the stop
set if Version > 3.0. See above for details.input
- Input TokenStreamstopWords
- A Set of Strings or char[] or any other toString()-able set
representing the stopwordsignoreCase
- if true, all words are lower cased first@Deprecated public StopFilter(boolean enablePositionIncrements, TokenStream in, Set<?> stopWords)
StopFilter(Version, TokenStream, Set)
insteadenablePositionIncrements
- true if token positions should record the removed stop wordsin
- Input streamstopWords
- A Set of Strings or char[] or any other toString()-able set representing the stopwordsmakeStopSet(Version, java.lang.String[])
public StopFilter(Version matchVersion, TokenStream in, Set<?> stopWords)
matchVersion
- Lucene version to enable correct Unicode 4.0 behavior in the stop
set if Version > 3.0. See above for details.in
- Input streamstopWords
- A Set of Strings or char[] or any other toString()-able set
representing the stopwordsmakeStopSet(Version, java.lang.String[])
@Deprecated public static final Set<Object> makeStopSet(String... stopWords)
makeStopSet(Version, String...)
insteadpassing false to ignoreCase
public static final Set<Object> makeStopSet(Version matchVersion, String... stopWords)
matchVersion
- Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0stopWords
- An array of stopwordspassing false to ignoreCase
@Deprecated public static final Set<Object> makeStopSet(List<?> stopWords)
makeStopSet(Version, List)
insteadstopWords
- A List of Strings or char[] or any other toString()-able list representing the stopwordsCharArraySet
) containing the wordspassing false to ignoreCase
public static final Set<Object> makeStopSet(Version matchVersion, List<?> stopWords)
matchVersion
- Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0stopWords
- A List of Strings or char[] or any other toString()-able list representing the stopwordsCharArraySet
) containing the wordspassing false to ignoreCase
@Deprecated public static final Set<Object> makeStopSet(String[] stopWords, boolean ignoreCase)
makeStopSet(Version, String[], boolean)
instead;stopWords
- An array of stopwordsignoreCase
- If true, all words are lower cased first.public static final Set<Object> makeStopSet(Version matchVersion, String[] stopWords, boolean ignoreCase)
matchVersion
- Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0stopWords
- An array of stopwordsignoreCase
- If true, all words are lower cased first.@Deprecated public static final Set<Object> makeStopSet(List<?> stopWords, boolean ignoreCase)
makeStopSet(Version, List, boolean)
insteadstopWords
- A List of Strings or char[] or any other toString()-able list representing the stopwordsignoreCase
- if true, all words are lower cased firstCharArraySet
) containing the wordspublic static final Set<Object> makeStopSet(Version matchVersion, List<?> stopWords, boolean ignoreCase)
matchVersion
- Lucene version to enable correct Unicode 4.0 behavior in the returned set if Version > 3.0stopWords
- A List of Strings or char[] or any other toString()-able list representing the stopwordsignoreCase
- if true, all words are lower cased firstCharArraySet
) containing the wordsprotected boolean accept() throws IOException
accept
in class FilteringTokenFilter
IOException
@Deprecated public static boolean getEnablePositionIncrementsVersionDefault(Version matchVersion)
StopFilter(Version, TokenStream, Set)
instead