|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.TokenFilter
org.apache.lucene.analysis.StopFilter
Removes stop words from a token stream.
Field Summary |
Fields inherited from class org.apache.lucene.analysis.TokenFilter |
input |
Constructor Summary | |
StopFilter(TokenStream in,
Set stopWords)
Constructs a filter which removes words from the input TokenStream that are named in the Set. |
|
StopFilter(TokenStream input,
Set stopWords,
boolean ignoreCase)
Construct a token stream filtering the given input. |
|
StopFilter(TokenStream input,
String[] stopWords)
Construct a token stream filtering the given input. |
|
StopFilter(TokenStream in,
String[] stopWords,
boolean ignoreCase)
Constructs a filter which removes words from the input TokenStream that are named in the array of words. |
Method Summary | |
static Set |
makeStopSet(String[] stopWords)
Builds a Set from an array of stop words, appropriate for passing into the StopFilter constructor. |
static Set |
makeStopSet(String[] stopWords,
boolean ignoreCase)
|
Token |
next()
Returns the next input Token whose termText() is not a stop word. |
Methods inherited from class org.apache.lucene.analysis.TokenFilter |
close |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StopFilter(TokenStream input, String[] stopWords)
public StopFilter(TokenStream in, String[] stopWords, boolean ignoreCase)
public StopFilter(TokenStream input, Set stopWords, boolean ignoreCase)
input
- stopWords
- The set of Stop Words, as Strings. If ignoreCase is true, all strings should be lower casedignoreCase
- -Ignore case when stopping. The stopWords set must be setup to contain only lower case wordspublic StopFilter(TokenStream in, Set stopWords)
makeStopSet(java.lang.String[])
Method Detail |
public static final Set makeStopSet(String[] stopWords)
passing false to ignoreCase
public static final Set makeStopSet(String[] stopWords, boolean ignoreCase)
stopWords
- ignoreCase
- If true, all words are lower cased first.
public final Token next() throws IOException
next
in class TokenStream
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |