mirror of https://github.com/apache/lucene.git
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:
parent
ca5b0a3ca0
commit
00b3e9d8a4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue