2017-02-17 43 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);