UIMA ruta WORDTABLE

时间:2015-11-03 16:29:21

标签: uima ruta

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

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

谢谢。

1 个答案:

答案 0 :(得分:0)

该示例包含错误。

脚本应该是这样的(行动错过了表总统OfUSA):

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的开发人员(我将修复文档)