mirror of https://github.com/apache/lucene.git
adding a constructor that takes stopwords as a Set
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@219090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2b9e6b6252
commit
28e1679191
|
@ -41,6 +41,12 @@ public final class StopAnalyzer extends Analyzer {
|
|||
stopWords = StopFilter.makeStopSet(ENGLISH_STOP_WORDS);
|
||||
}
|
||||
|
||||
/** Builds an analyzer with the stop words from the given set.
|
||||
*/
|
||||
public StopAnalyzer(Set stopWords) {
|
||||
this.stopWords = stopWords;
|
||||
}
|
||||
|
||||
/** Builds an analyzer which removes words in the provided array. */
|
||||
public StopAnalyzer(String[] stopWords) {
|
||||
this.stopWords = StopFilter.makeStopSet(stopWords);
|
||||
|
|
|
@ -41,6 +41,11 @@ public class StandardAnalyzer extends Analyzer {
|
|||
this(STOP_WORDS);
|
||||
}
|
||||
|
||||
/** Builds an analyzer with the given stop words. */
|
||||
public StandardAnalyzer(Set stopWords) {
|
||||
stopSet = stopWords;
|
||||
}
|
||||
|
||||
/** Builds an analyzer with the given stop words. */
|
||||
public StandardAnalyzer(String[] stopWords) {
|
||||
stopSet = StopFilter.makeStopSet(stopWords);
|
||||
|
|
Loading…
Reference in New Issue