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 2021/11/11 10:56:10 UTC
[uima-ruta] branch
bugfix/UIMA-6394-Ruta-label-assignment-in-alternative-match-causes-problems
created (now 0476c2a)
This is an automated email from the ASF dual-hosted git repository.
pkluegl pushed a change to branch bugfix/UIMA-6394-Ruta-label-assignment-in-alternative-match-causes-problems
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git.
at 0476c2a UIMA-6394: Ruta: label assignment in alternative match causes problems
This branch includes the following new commits:
new 0476c2a UIMA-6394: Ruta: label assignment in alternative match causes problems
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-6394: Ruta: label assignment in alternative
match causes problems
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-6394-Ruta-label-assignment-in-alternative-match-causes-problems
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git
commit 0476c2a217e3a9c1c9da834eec2099755f8ed107
Author: Peter Klügl <pe...@averbis.com>
AuthorDate: Thu Nov 11 11:54:26 2021 +0100
UIMA-6394: Ruta: label assignment in alternative match causes problems
- adding test
---
.../annotation/AnnotationLabelExpressionTest.java | 27 ++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java
index c4738aa..dd63f43 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java
@@ -845,4 +845,31 @@ public class AnnotationLabelExpressionTest {
RutaTestUtils.assertAnnotationsEquals(cas, 1, 1, "Some text");
}
+ @Test
+ public void testCompareStringFeatures() throws Exception {
+
+ String document = "A b.";
+ Map<String, String> typeMap = new TreeMap<String, String>();
+ typeMap.put("Struct1", "uima.tcas.Annotation");
+ typeMap.put("Struct2", "uima.tcas.Annotation");
+
+ Map<String, List<TestFeature>> featureMap = new TreeMap<String, List<TestFeature>>();
+ List<TestFeature> list = new ArrayList<RutaTestUtils.TestFeature>();
+ featureMap.put("Struct1", list);
+ featureMap.put("Struct2", list);
+ list.add(new TestFeature("s", "", "uima.cas.String"));
+
+ String script = "";
+ script += "SW{->CREATE(Struct2, \"s\" = \"b\")};\n";
+ script += "SW{->CREATE(Struct2, \"s\" = \"a\")};\n";
+ script += "CW{->CREATE(Struct1, \"s\" = \"a\")};\n";
+ script += "(s1:Struct1 s2:Struct2){s1.s==s2.s-> T1};\n";
+
+ CAS cas = RutaTestUtils.getCAS(document, typeMap, featureMap);
+ Ruta.apply(cas, script);
+
+ RutaTestUtils.assertAnnotationsEquals(cas, 1, 1, "A b");
+
+ }
+
}