- bugfix ticket #184
- bugfix deprecated frame for overlaps()
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java
index b1f3d1c..32897f7 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/AbstractSyntaxTree.java
@@ -184,7 +184,7 @@
if (allowedFrames.length==0 && classRefCheck[0]=="classRefCheck:includes") {
frame = "frame:contains";
- } else if (allowedFrames.length==0 && classRefCheck[0]=="classRefCheck:intersects") {
+ } else if (allowedFrames[0]=="frames:overlapsLeft" && allowedFrames[1]=="frames:overlapsRight" && classRefCheck[0]=="classRefCheck:intersects") {
frame = "frame:overlaps";
} else if (allowedFrames[0]=="frames:startswith" && classRefCheck[0]=="classRefCheck:includes") {
frame = "frame:startswith";
diff --git a/src/test/java/PoliqarpPlusTreeJSONTest.java b/src/test/java/PoliqarpPlusTreeJSONTest.java
index 49bac86..9c84feb 100644
--- a/src/test/java/PoliqarpPlusTreeJSONTest.java
+++ b/src/test/java/PoliqarpPlusTreeJSONTest.java
@@ -527,6 +527,29 @@
};
+ @Test
+ public void testPositions() throws QueryException, JsonProcessingException, IOException {
+ query = "contains(<s>, der)";
+ qs.setQuery(query, "poliqarpplus");
+ res = mapper.readTree(qs.toJSON());
+ assertEquals("korap:group", res.at("/query/@type").asText());
+ assertEquals("operation:position", res.at("/query/operation").asText());
+ assertEquals("frame:contains", res.at("/query/frame").asText());
+ assertEquals("korap:span", res.at("/query/operands/0/@type").asText());
+ assertEquals("s", res.at("/query/operands/0/key").asText());
+ assertEquals("korap:token", res.at("/query/operands/1/@type").asText());
+
+ query = "overlaps(<s>, der)";
+ qs.setQuery(query, "poliqarpplus");
+ res = mapper.readTree(qs.toJSON());
+ assertEquals("korap:group", res.at("/query/@type").asText());
+ assertEquals("operation:position", res.at("/query/operation").asText());
+ assertEquals("frame:overlaps", res.at("/query/frame").asText());
+ assertEquals("korap:span", res.at("/query/operands/0/@type").asText());
+ assertEquals("s", res.at("/query/operands/0/key").asText());
+ assertEquals("korap:token", res.at("/query/operands/1/@type").asText());
+ };
+
// }
//