Hi Erik,

which version of Ruta do you use? It looks like you use an old version
in your maven dependencies, in which this bug hasn't been fixed yet.


Best,


Peter

Am 27.07.2021 um 12:06 schrieb Erik Fäßler:
> Hi everyone,
>
> I have been having an issue with literal matching for quite some time now. In 
> the past, I just replaced all literal matching with word lists. In my current 
> script, however, this would be rather cumbersome.
> The error looks like this:
>
> java.lang.NullPointerException: null
>       at 
> org.apache.uima.ruta.rule.RutaLiteralMatcher.getAnnotation(RutaLiteralMatcher.java:72)
>       at 
> org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:62)
>       at 
> org.apache.uima.ruta.rule.RutaLiteralMatcher.getMatchingAnnotations(RutaLiteralMatcher.java:37)
>       at 
> org.apache.uima.ruta.rule.RutaRuleElement.getAnchors(RutaRuleElement.java:52)
>       at 
> org.apache.uima.ruta.rule.RutaRuleElement.startMatch(RutaRuleElement.java:60)
>       at 
> org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:87)
>       at 
> org.apache.uima.ruta.rule.ComposedRuleElement.startMatch(ComposedRuleElement.java:77)
>       at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:65)
>       at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:56)
>       at org.apache.uima.ruta.rule.RutaRule.apply(RutaRule.java:38)
>       at 
> org.apache.uima.ruta.block.RutaScriptBlock.apply(RutaScriptBlock.java:72)
>       at org.apache.uima.ruta.RutaModule.apply(RutaModule.java:56)
>       at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:612)
>       ... 11 common frames omitted
>
> So all I know is that something is null. But I have no idea what it could be. 
> I cannot even reproduce the issue in the Eclipse Workbench: The XMI files 
> that cause the error work without issue in Eclipse. The error only occurs 
> when running the CPE with the Ruta component that I created using the Maven 
> plugin.
> Hence, I don’t even know what part of my script is causing the error. I have 
> rules like this:
>
> (WS|"("|"/") (Greek|NUM|Roman) {->MARK(Specifier)} (WS|"("|"/“);
>
> which I think could be the cause. But this is based on the fact that I could 
> fix the error with word lists until now. Hints and ideas on how to circumvent 
> this issue are appreciated.
>
> Best,
>
> Erik

Reply via email to