增加一个属性
public static String path = "data/stopwords/stopwords_en.txt"; File txt = new File(path); 调用isStopword方法之前执行如下语句:
StopwordsEnglish.path = "新路径";
public static String path = "data/stopwords/stopwords_en.txt"; File txt = new File(path); 调用isStopword方法之前执行如下语句:
StopwordsEnglish.path = "新路径";
配置信息在类加载的时候读取.这样性能更好啊.
而且用xml做配置文件,增加了程序的可扩展性.