dicHome = "classpath:dic/";
}
}
}
if (dicHome == null) {
throw new PaodingAnalysisException(
"please set a system env PAODING_DIC_HOME or Config paoding.dic.home in paoding-dic-home.properties point to the dictionaries!");
}
// 规范化dicHome,并设置到属性文件对象中
dicHome = dicHome.replace('\\', '/');
if (!dicHome.endsWith("/")) {
dicHome = dicHome + "/";
}
p.setProperty(Constants.DIC_HOME, dicHome);// writer to the properites
// object
// 将dicHome转化为一个系统唯一的绝对路径,记录在属性对象中
File dicHomeFile = getFile(dicHome);
if (!dicHomeFile.exists()) {
throw new PaodingAnalysisException(
"not found the dic home dirctory! "
+ dicHomeFile.getAbsolutePath());
}
if (!dicHomeFile.isDirectory()) {
throw new PaodingAnalysisException(
"dic home should not be a file, but a directory!");
}
p.setProperty("paoding.dic.home.absolute.path", dicHomeFile
.getAbsolutePath());
}