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/26 16:31:55 UTC
[uima-ruta] 01/01: UIMA-6414: Ruta: missing match for optional after sidestep out of composed
This is an automated email from the ASF dual-hosted git repository.
pkluegl pushed a commit to branch bugfix/UIMA-6414-Ruta-missing-match-for-optional-after-sidestep-out-of-composed
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git
commit 7d6808d7a1d4e5863d900dc534554b27e9e1b45d
Author: Peter Klügl <pe...@averbis.com>
AuthorDate: Wed Jan 26 17:31:27 2022 +0100
UIMA-6414: Ruta: missing match for optional after sidestep out of composed
- added test
---
.../uima/ruta/rule/RutaOptionalRuleElementTest.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/rule/RutaOptionalRuleElementTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/rule/RutaOptionalRuleElementTest.java
index 4514779..4d3b2b7 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/rule/RutaOptionalRuleElementTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/rule/RutaOptionalRuleElementTest.java
@@ -39,4 +39,19 @@ public class RutaOptionalRuleElementTest {
}
+ @Test
+ public void testOptionalBeforeComposed() throws Exception {
+ String document = "test 05/05 test\n";
+ document += "test 06/06 . test\n";
+ document += "test . 07/07 test\n";
+ String script = "ADDRETAINTYPE(WS);";
+ script += "_{PARTOF(PM)} (NUM SPECIAL @NUM){-> T1} _{PARTOF({PM})};\n";
+
+ CAS cas = RutaTestUtils.getCAS(document);
+ Ruta.apply(cas, script);
+
+ RutaTestUtils.assertAnnotationsEquals(cas, 1, 1, "05/05");
+
+ }
+
}