2017-02-17 38 views
1

我想从java中使用GATE SUMMA。我正在尝试运行教程中包含的文件。我已经单独下载了ANNIE和SUMMA插件。我不明白的是配置中的这一部分。GATE 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 

我看到克里奥尔语是GATE框架下的一个类型的配置管理。我需要为此创建一个xml文件吗?

完整的类文件所示的Gist()

回答

1

我需要有创建一个XML文件?

是,

Gate.getCreoleRegister().addDirectory(URL) 

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

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

我不知道SUMMA,但我想它也有地方这样一个目录...


的方法addDirectory(URL)是未定义的类型CreoleRegister

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

+0

是的,你正确的,现在''我认为这是在当前GATE CreoleRegister.registerDirectories(URL)方法(版本8.x的系列)''代替。 – Betafish

1

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

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