Methods Summary |
---|
public static final java.util.Set | makeStopSet(java.lang.String[] stopWords)Builds a Set from an array of stop words,
appropriate for passing into the StopFilter constructor.
This permits this stopWords construction to be cached once when
an Analyzer is constructed.
HashSet stopTable = new HashSet(stopWords.length);
for (int i = 0; i < stopWords.length; i++)
stopTable.add(stopWords[i]);
return stopTable;
|
public static final java.util.Hashtable | makeStopTable(java.lang.String[] stopWords)Builds a Hashtable from an array of stop words,
appropriate for passing into the StopFilter constructor.
This permits this table construction to be cached once when
an Analyzer is constructed.
Hashtable stopTable = new Hashtable(stopWords.length);
for (int i = 0; i < stopWords.length; i++)
stopTable.put(stopWords[i], stopWords[i]);
return stopTable;
|
public final org.apache.lucene.analysis.Token | next()Returns the next input Token whose termText() is not a stop word.
// return the first non-stop word found
for (Token token = input.next(); token != null; token = input.next())
if (!stopWords.contains(token.termText))
return token;
// reached EOS -- return null
return null;
|