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:
Daniel Naber 2005-07-14 20:36:28 +00:00
parent 2b9e6b6252
commit 28e1679191
2 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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);