1

我尝试在这里运行 WORDTABLE 示例。但我得到了一个错误。这是代码:

WORDTABLE presidentsOfUSA = 'presidentsOfUSA.csv';
DECLARE Annotation PresidentOfUSA(STRING party, INT yearOfInauguration);
Document{->MARKTABLE(PresidentOfUSA, 1, "party" = 2, "yearOfInauguration" = 3)};

这是错误的一部分。我无法将所有内容都放在帖子中:

Exception in thread "main" org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.apache.uima.ruta.engine.RutaEngine" failed.  (Descriptor: file:/home/david/soft/rutatest/test/descriptor/TableEngine.xml)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:264)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:169)
    at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
    at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
    at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
    at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:371)
    at org.apache.uima.ruta.engine.Ruta.wrapAnalysisEngine(Ruta.java:95)
    at org.apache.uima.ruta.ide.launching.RutaLauncher.main(RutaLauncher.java:123)
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Table,  line 3, ""party"": found no viable alternative
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:384)
    at org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:692)
    at org.apache.uima.ruta.engine.RutaEngine.loadScript(RutaEngine.java:1062)
    at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:744)
    at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:517)
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:262)
    ... 7 more

谢谢你。

4

1 回答 1

0

该示例包含错误。

脚本应该看起来像(动作错过了美国总统表):

WORDTABLE presidentsOfUSA = 'presidentsOfUSA.csv'; 
DECLARE Annotation PresidentOfUSA(STRING party, INT yearOfInauguration);
Document{->MARKTABLE(PresidentOfUSA, 1, presidentsOfUSA, "party" = 2, 
    "yearOfInauguration" = 3)};

...并且 csv 文件不应在数字单元格中包含空格:

Bill Clinton;democrats;1993
George W. Bush; republicans;2001
Barack Obama;democrats;2009

免责声明:我是 UIMA Ruta 的开发人员(我将修复文档)

于 2015-11-04T08:10:28.257 回答