From 00b3e9d8a482d161d6363353f1664e651a7e4b52 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Wed, 22 Jun 2005 20:05:13 +0000 Subject: [PATCH] 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 --- src/java/org/apache/lucene/analysis/StopAnalyzer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/lucene/analysis/StopAnalyzer.java b/src/java/org/apache/lucene/analysis/StopAnalyzer.java index 7ac1b3f1ce6..613dc2aa1d5 100644 --- a/src/java/org/apache/lucene/analysis/StopAnalyzer.java +++ b/src/java/org/apache/lucene/analysis/StopAnalyzer.java @@ -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);