• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

嵌入GATE并尝试编译并运行StandAloneAnnie

java 来源:Ariadne 5次浏览

我一直在试图学习GATE,特别是ANNIE和TwitIE。我见过在GATE网站上发现的独立ANNIE java代码(https://gate.ac.uk/wiki/code-repository/src/sheffield/examples/StandAloneAnnie.java)。我试图运行java文件,但我总是收到此错误信息(因为我真的不知道如何嵌入门,请告诉我如何一步一步):嵌入GATE并尝试编译并运行StandAloneAnnie


log4j:WARN No appenders could be found for logger (gate.Gate). 
log4j:WARN Please initialize the log4j system properly. 
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 
Exception in thread "main" gate.util.GateRuntimeException: Could not infer installed plug-ins home! 
Please set it manually using the -Dgate.plugins.home option in your start-up script. 
    at gate.Gate.initLocalPaths(Gate.java:303) 
    at gate.Gate.init(Gate.java:163) 
    at StandAloneAnnie.main(StandAloneAnnie.java:81) 
Java Result: 1 

的问题来自于声明:

Gate.init();

请帮助,我非常需要它。谢谢你们:)

===========解决方案如下:

我暂时通过在代码GATE的初始化之前解决了这个问题: Gate.init()

这组代码:


Properties props2 = System.getProperties(); 
props2.setProperty("gate.plugins.home", "C:\\Program Files\\GATE_Developer_8.0\\plugins"); 
Properties props3 = System.getProperties(); 
props3.setProperty("gate.site.config", "C:\\Program Files\\GATE_Developer_8.0\\gate.xml");

我希望这也将帮助别人:)


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)