|
|
@@ -4,7 +4,6 @@ import com.hankcs.hanlp.utility.Predefine; |
|
|
|
import com.indexea.ideaseg.core.IdeasegIOAdapter; |
|
|
|
import com.indexea.ideaseg.core.PluginBase; |
|
|
|
import org.apache.lucene.analysis.Analyzer; |
|
|
|
import org.elasticsearch.common.io.PathUtils; |
|
|
|
import org.elasticsearch.common.settings.Settings; |
|
|
|
import org.elasticsearch.env.Environment; |
|
|
|
import org.elasticsearch.index.analysis.AnalyzerProvider; |
|
|
@@ -35,7 +34,7 @@ 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 = PathUtils.get(home, "plugins", PLUGIN_NAME); |
|
|
|
Path pluginHome = java.nio.file.FileSystems.getDefault().getPath(home, "plugins", PLUGIN_NAME); |
|
|
|
IdeasegIOAdapter.BASE_PATH = pluginHome.toString() + File.separator; //设置 HanLP 根目录 |
|
|
|
Predefine.HANLP_PROPERTIES_PATH = IdeasegIOAdapter.BASE_PATH + CONFIG_FILE_NAME; |
|
|
|
} |
|
|
|