Bugfix for query deserialization of unspecified boundaries
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java
index 0d99899..842cead 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java
@@ -274,6 +274,18 @@
assertEquals(sqwi.toQuery().toString(), "spanNext(spanOr([tokens:s:der, spanNext(tokens:s:der, spanRepetition(tokens:cnx/p:A{1,2}))]), tokens:tt/p:NN)");
};
+
+ @Test
+ public void queryJSONboundaryBug () {
+ SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp-boundary.jsonld").getFile());
+
+ // Tal []{1,} Wald
+ assertEquals(sqwi.toQuery().toString(), "spanDistance(tokens:s:Tal, tokens:s:Wald, [(w[2:100], ordered, notExcluded)])");
+ };
+
+
+
+
public static String getString (String path) {
StringBuilder contentBuilder = new StringBuilder();
try {
diff --git a/src/test/resources/queries/bsp-boundary.jsonld b/src/test/resources/queries/bsp-boundary.jsonld
new file mode 100644
index 0000000..f93fa14
--- /dev/null
+++ b/src/test/resources/queries/bsp-boundary.jsonld
@@ -0,0 +1 @@
+{"@context":"http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld","errors":[],"warnings":[],"announcements":["Deprecated 2014-07-24: 'min' and 'max' to be supported until 3 months from deprecation date."],"query":{"@type":"korap:group","operation":"operation:sequence","operands":[{"@type":"korap:token","wrap":{"@type":"korap:term","layer":"orth","key":"Tal","match":"match:eq"}},{"@type":"korap:token","wrap":{"@type":"korap:term","layer":"orth","key":"Wald","match":"match:eq"}}],"inOrder":true,"distances":[{"@type":"korap:distance","key":"w","boundary":{"@type":"korap:boundary","min":2},"min":2}]},"collections":[{"@type":"korap:meta-filter","@value":{"@type":"korap:term","@field":"korap:field#corpusID","@value":"WPD"}}],"meta":{"startPage":1,"itemsPerResource":1,"context":"paragraph"}}