new method to get stop words from reader

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@192991 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2005-06-22 20:05:13 +00:00
parent ca5b0a3ca0
commit 00b3e9d8a4
1 changed files with 10 additions and 1 deletions

View File

@ -46,11 +46,20 @@ public final class StopAnalyzer extends Analyzer {
this.stopWords = StopFilter.makeStopSet(stopWords);
}
/** Builds an analyzer with the stop words from the given file. */
/** Builds an analyzer with the stop words from the given file.
* @see WordlistLoader#getWordSet(File)
*/
public StopAnalyzer(File stopwordsFile) throws IOException {
stopWords = WordlistLoader.getWordSet(stopwordsFile);
}
/** Builds an analyzer with the stop words from the given reader.
* @see WordlistLoader#getWordSet(Reader)
*/
public StopAnalyzer(Reader stopwords) throws IOException {
stopWords = WordlistLoader.getWordSet(stopwords);
}
/** Filters LowerCaseTokenizer with StopFilter. */
public TokenStream tokenStream(String fieldName, Reader reader) {
return new StopFilter(new LowerCaseTokenizer(reader), stopWords);