提交 092a9ad7 编写于 作者: goBD's avatar goBD

Update Configuration.java

在配置中增加远程词典和远程停用词,以及它们的配置读取
上级 4a00e824
......@@ -17,7 +17,9 @@ public class Configuration {
private static String FILE_NAME = "ik/IKAnalyzer.cfg.xml";
private static final String EXT_DICT = "ext_dict";
private static final String REMOTE_EXT_DICT = "remote_ext_dict";
private static final String EXT_STOP = "ext_stopwords";
private static final String REMOTE_EXT_STOP = "remote_ext_stopwords";
private static ESLogger logger = null;
private Properties props;
private Environment environment;
......@@ -64,6 +66,24 @@ public class Configuration {
}
return extDictFiles;
}
public List<String> getRemoteExtDictionarys(){
List<String> remoteExtDictFiles = new ArrayList<String>(2);
String remoteExtDictCfg = props.getProperty(REMOTE_EXT_DICT);
if(remoteExtDictCfg != null){
String[] filePaths = remoteExtDictCfg.split(";");
if(filePaths != null){
for(String filePath : filePaths){
if(filePath != null && !"".equals(filePath.trim())){
remoteExtDictFiles.add(filePath);
}
}
}
}
return remoteExtDictFiles;
}
public List<String> getExtStopWordDictionarys(){
List<String> extStopWordDictFiles = new ArrayList<String>(2);
......@@ -83,6 +103,24 @@ public class Configuration {
}
return extStopWordDictFiles;
}
public List<String> getRemoteExtStopWordDictionarys(){
List<String> remoteExtStopWordDictFiles = new ArrayList<String>(2);
String remoteExtStopWordDictCfg = props.getProperty(REMOTE_EXT_STOP);
if(remoteExtStopWordDictCfg != null){
String[] filePaths = remoteExtStopWordDictCfg.split(";");
if(filePaths != null){
for(String filePath : filePaths){
if(filePath != null && !"".equals(filePath.trim())){
remoteExtStopWordDictFiles.add(filePath);
}
}
}
}
return remoteExtStopWordDictFiles;
}
public File getDictRoot() {
return environment.configFile();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册