2016-09-08 2 views
1

UIMA 적합 파이프 라인에서 간단한 예제 Ruta 스크립트를 실행하려고합니다. 별도 루타 프로젝트와 테스트 주석이 생성을 가진 독립형 스크립트로 실행할 때UIMA-Fit에서 실행할 때 stringfunctions가있는 UIMA RUTA 스크립트가 작동하지 않습니다.

STRING s; 
BOOLEAN a; 
STRING s2 = "LAuGH"; 
DECLARE Test; 
BLOCK(forEACH) W{}{ 
    W{->MATCHEDTEXT(s), ASSIGN(a,equals(s,s2))}; 
    W{->MATCHEDTEXT(s), ASSIGN(a,equalsIgnoreCase(s,s2))}; 
    W{a ->Test}; 
} 

이 스크립트는 잘 작동합니다. 그러나, UIMA에 맞는 파이프 라인과 자바 프로젝트에서, 나는 다음과 같은 오류가 발생합니다 :

Sep 08, 2016 1:49:14 PM de.tudarmstadt.ukp.dkpro.core.api.io.ResourceCollectionReaderBase scan(393) 
INFO: Scanning [file:/home/himanshu_shivhare/workspace/annotate_ruta_example-master/src/main/resources/data/] 
Sep 08, 2016 1:49:14 PM de.tudarmstadt.ukp.dkpro.core.api.io.ResourceCollectionReaderBase initialize(224) 
INFO: Found [1] resources to be read 
Exception in thread "main" org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.apache.uima.ruta.engine.RutaEngine" failed. (Descriptor: <unknown>) 
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:271) 
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize(PrimitiveAnalysisEngine_impl.java:170) 
    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:407) 
    at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256) 
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:429) 
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:373) 
    at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:186) 
    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.produceResource(UIMAFramework.java:331) 
    at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448) 
    at org.apache.uima.fit.factory.AnalysisEngineFactory.createEngine(AnalysisEngineFactory.java:205) 
    at org.apache.uima.fit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:82) 
    at example.Annotate.main(Annotate.java:49) 
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: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:726) 
    at org.apache.uima.ruta.engine.RutaEngine.loadScript(RutaEngine.java:1087) 
    at org.apache.uima.ruta.engine.RutaEngine.initializeScript(RutaEngine.java:756) 
    at org.apache.uima.ruta.engine.RutaEngine.initialize(RutaEngine.java:530) 
    at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:266) 
    ... 17 more 
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: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:825) 
    at org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:712) 
    ... 21 more 
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: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1038) 
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:804) 
    ... 22 more 
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 Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.blockDeclaration(RutaParser.java:2940) 
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1010) 
    ... 23 more 
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: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:825) 
    at org.apache.uima.ruta.parser.RutaParser.blockDeclaration(RutaParser.java:2921) 
    ... 24 more 
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: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1038) 
    at org.apache.uima.ruta.parser.RutaParser.statements(RutaParser.java:804) 
    ... 25 more 
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: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.simpleStatement(RutaParser.java:3266) 
    at org.apache.uima.ruta.parser.RutaParser.statement(RutaParser.java:1000) 
    ... 26 more 
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: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.ruleElementsRoot(RutaParser.java:3796) 
    at org.apache.uima.ruta.parser.RutaParser.simpleStatement(RutaParser.java:3250) 
    ... 27 more 
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: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.ruleElement(RutaParser.java:4156) 
    at org.apache.uima.ruta.parser.RutaParser.ruleElementsRoot(RutaParser.java:3739) 
    ... 28 more 
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: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.ruleElementType(RutaParser.java:4722) 
    at org.apache.uima.ruta.parser.RutaParser.ruleElement(RutaParser.java:3994) 
    ... 29 more 
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: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.actions(RutaParser.java:5106) 
    at org.apache.uima.ruta.parser.RutaParser.ruleElementType(RutaParser.java:4688) 
    ... 30 more 
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.action(RutaParser.java:11623) 
    at org.apache.uima.ruta.parser.RutaParser.actions(RutaParser.java:5085) 
    ... 31 more 
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:393) 
    at org.apache.uima.ruta.parser.RutaParser.actionAssign(RutaParser.java:14714) 
    at org.apache.uima.ruta.parser.RutaParser.action(RutaParser.java:11305) 
    ... 32 more 
Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: Error in Example, line 28, "(": found no viable alternative 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:358) 
    at org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:372) 
    at org.apache.uima.ruta.parser.RutaParser.booleanExpression(RutaParser.java:19535) 
    at org.apache.uima.ruta.parser.RutaParser.actionAssign(RutaParser.java:14631) 
    ... 33 more 

스크립트는 이상하다, 구문 분석하는 데 실패합니다. 나는 maven repo (2.4.0)에서 최신 버전의 ruta-core를 사용하고 있습니다. 왜 이런 일이 일어나는 지 아는 사람이 있습니까? 감사.

답변

0

사전 구성된 설명자를 사용하지 않고 분석 엔진을 uimaFIT를 사용하여 수동으로 생성했지만 RutaEngine.class 구현 만 사용하는 경우 매개 변수 additionalExtension을 직접 구성해야합니다. 이 매개 변수는 언어 확장 팩토리를 나열합니다.

트릭을 할해야

... = AnalysisEngineFactory.createEngine(RutaEngine.class, RutaEngine.PARAM_ADDITIONAL_EXTENSIONS, new String[]{BooleanOperationsExtension.class.getName(), StringOperationsExtension.class.getName()}); 

... = AnalysisEngineFactory.createEngine(RutaEngine.class); 

와 자바 라인을 변경.

면책 조항 : 나는 그것은 지금 작동 UIMA 루타

+0

의 개발자입니다. 도와 줘서 고마워, 피터. –