|
|
@@ -13,6 +13,7 @@ import org.elasticsearch.plugins.AnalysisPlugin; |
|
|
|
import org.elasticsearch.plugins.Plugin; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.nio.file.FileSystems; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
@@ -34,8 +35,8 @@ public class IdeasegPlugin extends Plugin implements AnalysisPlugin, PluginBase |
|
|
|
home = Environment.PATH_HOME_SETTING.get(settings); |
|
|
|
if (home == null) |
|
|
|
throw new IllegalStateException(Environment.PATH_HOME_SETTING.getKey() + " is not configured"); |
|
|
|
Path pluginHome = java.nio.file.FileSystems.getDefault().getPath(home, "plugins", PLUGIN_NAME); |
|
|
|
IdeasegIOAdapter.BASE_PATH = pluginHome.toString() + File.separator; //设置 HanLP 根目录 |
|
|
|
Path pluginHome = FileSystems.getDefault().getPath(home, "plugins", PLUGIN_NAME); |
|
|
|
IdeasegIOAdapter.BASE_PATH = pluginHome + File.separator; //设置 HanLP 根目录 |
|
|
|
Predefine.HANLP_PROPERTIES_PATH = IdeasegIOAdapter.BASE_PATH + CONFIG_FILE_NAME; |
|
|
|
} |
|
|
|
|
|
|
|