You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Michael Stenger (Jira)" <de...@uima.apache.org> on 2021/03/03 10:31:00 UTC

[jira] [Commented] (UIMA-6324) | and & REs may miss matches

    [ https://issues.apache.org/jira/browse/UIMA-6324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17294448#comment-17294448 ] 

Michael Stenger commented on UIMA-6324:
---------------------------------------

I do have a further remark which seems to be closely related to this issue. However, I can open a second one if you like.

 Assuming the same text as above, but two different scripts:
{noformat}
 DECLARE A, B, C;
 
 "A" {-> A, A};
 "A" {-> B};
 
 (A | B){-> C};
{noformat}
 and
{noformat}
DECLARE A, B, C;
 
 "A" {-> A, A};
 "A" {-> B};
 
 A{-> C};
{noformat}
The first one yields 2, the second one 4 C annotations. Considered separately, each behaviour seems reasonable, but not anymore when compared: I don't see why a rule would yield less annotations after being relaxed by |. I guess this is a result of a collaps of different matches when putting them in one of the Maps saving the RuleMatches in ComposedRuleElement class. However, I've been unable to fully understand what's going on there.

Best, Michael

> | and & REs may miss matches
> ----------------------------
>
>                 Key: UIMA-6324
>                 URL: https://issues.apache.org/jira/browse/UIMA-6324
>             Project: UIMA
>          Issue Type: Bug
>          Components: Ruta
>    Affects Versions: 2.8.1ruta
>            Reporter: Michael Stenger
>            Assignee: Peter Klügl
>            Priority: Minor
>             Fix For: 2.9.0ruta
>
>
> Hey Peter...
> I have two examples where rules using | and & presumably miss out matches. However, this may be cause by other steps of the execution process than these rule elements since I couldn't find a bug in ComposedRuleElement class. Hopefully, you can enlighten me on this. I used the Workbench to test this:
>  * Example 1
> Text:
> {noformat}
> A B A B
> {noformat}
> Script:
> {noformat}
> DECLARE A, B, C;
> "A" {-> A};
> "B" {-> B};
> ((B A) | ("B" "A")){-> C} W;
> {noformat}
> I'd expect a C annotation on "B A" here, but it only outputs the A and B annotations from the first 2 rules. On the other hand, if I replace the | with &, it creates a C as exprected. That doesn't seem right. | should be a less strong condition.
>  * Example 2
> Text (same):
> {noformat}
> A B A B
> {noformat}
> Script:
> {noformat}
> DECLARE A, B, C;
> "A" {-> A};
> "B" {-> B};
> ((B A) & ("B" "A")){-> C} @W;
> {noformat}
> Here, its the other way around, meaning that a C annotation is created using |, but not &. I don't see way either the direction or the use of &/| should make any difference in this case.
> Thanks,
>  Michael
>  
> Btw: Can I assign this issue myself and just unable to find the button for that or do I lack permission?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)