mirror of https://github.com/apache/lucene.git
convert map to set
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150996 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6dfd88a659
commit
f920cff71a
|
@ -22,7 +22,7 @@ import org.apache.lucene.analysis.standard.*;
|
||||||
import net.sf.snowball.ext.*;
|
import net.sf.snowball.ext.*;
|
||||||
|
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.util.Hashtable;
|
import java.util.Set;
|
||||||
|
|
||||||
/** Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
|
/** Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
|
||||||
* LowerCaseFilter}, {@link StopFilter} and {@link SnowballFilter}.
|
* LowerCaseFilter}, {@link StopFilter} and {@link SnowballFilter}.
|
||||||
|
@ -33,7 +33,7 @@ import java.util.Hashtable;
|
||||||
*/
|
*/
|
||||||
public class SnowballAnalyzer extends Analyzer {
|
public class SnowballAnalyzer extends Analyzer {
|
||||||
private String name;
|
private String name;
|
||||||
private Hashtable stopTable;
|
private Set stopSet;
|
||||||
|
|
||||||
/** Builds the named analyzer with no stop words. */
|
/** Builds the named analyzer with no stop words. */
|
||||||
public SnowballAnalyzer(String name) {
|
public SnowballAnalyzer(String name) {
|
||||||
|
@ -43,7 +43,7 @@ public class SnowballAnalyzer extends Analyzer {
|
||||||
/** Builds the named analyzer with the given stop words. */
|
/** Builds the named analyzer with the given stop words. */
|
||||||
public SnowballAnalyzer(String name, String[] stopWords) {
|
public SnowballAnalyzer(String name, String[] stopWords) {
|
||||||
this(name);
|
this(name);
|
||||||
stopTable = StopFilter.makeStopTable(stopWords);
|
stopSet = StopFilter.makeStopSet(stopWords);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Constructs a {@link StandardTokenizer} filtered by a {@link
|
/** Constructs a {@link StandardTokenizer} filtered by a {@link
|
||||||
|
@ -52,8 +52,8 @@ public class SnowballAnalyzer extends Analyzer {
|
||||||
TokenStream result = new StandardTokenizer(reader);
|
TokenStream result = new StandardTokenizer(reader);
|
||||||
result = new StandardFilter(result);
|
result = new StandardFilter(result);
|
||||||
result = new LowerCaseFilter(result);
|
result = new LowerCaseFilter(result);
|
||||||
if (stopTable != null)
|
if (stopSet != null)
|
||||||
result = new StopFilter(result, stopTable);
|
result = new StopFilter(result, stopSet);
|
||||||
result = new SnowballFilter(result, name);
|
result = new SnowballFilter(result, name);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue