You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2022/01/03 09:37:05 UTC

[uima-ruta] branch bugfix/UIMA-6404-Ruta-anchor-with-quantifier-ignores-matches created (now 11e09e0)

This is an automated email from the ASF dual-hosted git repository.

pkluegl pushed a change to branch bugfix/UIMA-6404-Ruta-anchor-with-quantifier-ignores-matches
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git.


      at 11e09e0  UIMA-6404: Ruta: @ with quantifier ignores matches

This branch includes the following new commits:

     new 11e09e0  UIMA-6404: Ruta: @ with quantifier ignores matches

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[uima-ruta] 01/01: UIMA-6404: Ruta: @ with quantifier ignores matches

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkluegl pushed a commit to branch bugfix/UIMA-6404-Ruta-anchor-with-quantifier-ignores-matches
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git

commit 11e09e053e0638c974e4b36d744e213dc3f1f4ba
Author: Peter Klügl <pe...@averbis.com>
AuthorDate: Mon Jan 3 10:36:38 2022 +0100

    UIMA-6404: Ruta: @ with quantifier ignores matches
    
    - added test mentioned in issue
---
 .../ruta/rule/quantifier/MinMaxQuantifierTest.java  | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/rule/quantifier/MinMaxQuantifierTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/rule/quantifier/MinMaxQuantifierTest.java
index 425ee0e..55fe85b 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/rule/quantifier/MinMaxQuantifierTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/rule/quantifier/MinMaxQuantifierTest.java
@@ -37,6 +37,25 @@ public class MinMaxQuantifierTest {
     Ruta.apply(cas, script);
 
     RutaTestUtils.assertAnnotationsEquals(cas, 1, 1, "B, B, B");
-    cas.release();
+  }
+
+  @Test
+  public void testMinMaxOnComposedWithAnchor() throws Exception {
+    String document = "omega alpha beta gamma omega alpha beta gamma omega alpha";
+    String script = "";
+    script += "(W @W W W)[2,2]{-> T1};\n";
+    script += "(W W @W W)[2,2]{-> T2};\n";
+
+    CAS cas = RutaTestUtils.getCAS(document);
+    Ruta.apply(cas, script);
+
+    RutaTestUtils.assertAnnotationsEquals(cas, 1, 3,
+            "omega alpha beta gamma omega alpha beta gamma",
+            "alpha beta gamma omega alpha beta gamma omega",
+            "beta gamma omega alpha beta gamma omega alpha");
+    RutaTestUtils.assertAnnotationsEquals(cas, 2, 3,
+            "omega alpha beta gamma omega alpha beta gamma",
+            "alpha beta gamma omega alpha beta gamma omega",
+            "beta gamma omega alpha beta gamma omega alpha");
   }
 }