Re: UIMA RUTA script with stringfunctions doesnt work when executing from UIMA-Fit

2016-09-09 Thread Richard Eckart de Castilho
On 08.09.2016, at 19:46, Peter Klügl  wrote:
> 
> Sorry, that was the wrong extension... it should read:
> 
> = AnalysisEngineFactory.createEngine(RutaEngine.class, 
> RutaEngine.PARAM_ADDITIONAL_EXTENSIONS, new 
> String[]{BooleanOperationsExtension.class.getName()});
> 
> btw its better to create a description first, and then the analysis engine.

Unless you want to reuse the engine, it's actually a good idea not to 
instantiate the engine at all, but to leave that to e.g. 
SimplePipeline.runPipeline(), to the CPE or some other pre-build execution code 
which also ensures that all the lifecycle events are properly invoked on the 
engine.

Cheers,

-- Richard

Re: UIMA RUTA script with stringfunctions doesnt work when executing from UIMA-Fit

2016-09-08 Thread Peter Klügl

Sorry, that was the wrong extension... it should read:

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


btw its better to create a description first, and then the analysis engine.

Best,

Peter

Am 08.09.2016 um 13:50 schrieb Peter Klügl:

Hi,


what is the content of line 28 in your script? I assume it's the line
with "equalsIgnoreCase", right?


How do you create the analysis engine for your ruta script? I assume
that you use something like:


AnalysisEngineFactory.createEngineDescription(RutaEngine.class, ...)


Do you set values for the configuration parameters (the "..." part),
especially the configuration parameter "additionalExtensions"?


The values for this configurtation parameter are normally set
automatically by the Workbench or by the ruta-maven-plugin. If you use
plain uimaFIT to create your analysis engine you need to specify the
extensions by yourself.

Something like:


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


should do the trick. You can also take a look at the analysis engine
descriptors in your ruta project, which extensions are configured
automatically.


Best,


Peter






Re: UIMA RUTA script with stringfunctions doesnt work when executing from UIMA-Fit

2016-09-08 Thread Peter Klügl
Hi,


what is the content of line 28 in your script? I assume it's the line
with "equalsIgnoreCase", right?


How do you create the analysis engine for your ruta script? I assume
that you use something like:


AnalysisEngineFactory.createEngineDescription(RutaEngine.class, ...)


Do you set values for the configuration parameters (the "..." part),
especially the configuration parameter "additionalExtensions"?


The values for this configurtation parameter are normally set
automatically by the Workbench or by the ruta-maven-plugin. If you use
plain uimaFIT to create your analysis engine you need to specify the
extensions by yourself.

Something like:


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


should do the trick. You can also take a look at the analysis engine
descriptors in your ruta project, which extensions are configured
automatically.


Best,


Peter




UIMA RUTA script with stringfunctions doesnt work when executing from UIMA-Fit

2016-09-08 Thread Himanshu Shivhare-Crimson Interactive

Hi,

I am trying to execute a simple example Ruta script (from the 
documentation) from a UIMA fit pipeline with some DKPro annotators.


|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}; } |


This script works fine when executing it as a standalone script with a 
separate RUTA project and the Test annotation is created. However, in a 
java project with a UIMA fit pipeline, I get the following error:


|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: ) 
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.apach