门总和配置

GATE SUMMA configuration

我正在尝试使用 java 中的 GATE SUMMA。我正在尝试 运行 本教程中包含的文件。我已经分别下载了 ANNIE 和 SUMMA 插件。我不明白的是配置中的这一部分。

 Gate.init();
            // you have to register the plugins from GATE you want to use
             Gate.getCreoleRegister().addDirectory(new URL("file:///"+anniePluginDir));
            // you have to register the SUMMA plugin to have access to its resources
            Gate.getCreoleRegister().addDirectory(new URL("file:///"+summaPluginDir));
            // now create your controller

这是什么意思you have to register the plugins from GATE you want to use 即使提供插件路径也会抛出错误

The method addDirectory(URL) is undefined for the type CreoleRegister

我看到Creole是GATE框架下的一种配置管理。我需要为此创建一个 xml 文件吗?

完整的class文件如图Gist()

Do I need to have an xml file created for that?

是的,

Gate.getCreoleRegister().addDirectory(URL)

注册 GATE 插件目录,其中必须包含 creole.xml 文件。

ANNIE 插件目录是常见 GATE 安装的一部分(参见 $GATE_HOME\plugins\ANNIE 目录)。

我不知道 SUMMA,但我猜它在某处也有这样的目录...


但是

The method addDirectory(URL) is undefined for the type CreoleRegister

表示您的代码是为不同版本的 GATE 创建的。显然,您当前版本的 GATE 没有 addDirectory(URL) 方法。我认为它被替换为 CreoleRegister.registerDirectories(URL) 当前 GATE 中的方法(ver. 8.x 系列)。

添加@dedek 所说的内容。实际代码是

 URL ANNIEcreoleURL = new URL("resources/plugins/ANNIE");
 Gate.getCreoleRegister().registerDirectories(ANNIEcreoleURL);