- Renamed subspan to submatch, ambiguity with classRef-operator 'submatch' is resolved by the number of arguments
- Set deprecation policy to 3 months (expires end of October)
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 1b2ff74..d5b36d4 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
@@ -129,7 +129,7 @@
if (max != null) {
group.put("max", max);
}
- announcements.add("Deprecated 2014-07-24: 'min' and 'max' to be supported until 6 months from deprecation date.");
+ announcements.add("Deprecated 2014-07-24: 'min' and 'max' to be supported until 3 months from deprecation date.");
return group;
}
@@ -184,7 +184,7 @@
if (max != null) {
group.put("max", max);
}
- announcements.add("Deprecated 2014-07-24: 'min' and 'max' to be supported until 6 months from deprecation date.");
+ announcements.add("Deprecated 2014-07-24: 'min' and 'max' to be supported until 3 months from deprecation date.");
return group;
}
@@ -192,7 +192,9 @@
LinkedHashMap<String, Object> group = new LinkedHashMap<String, Object>();
group.put("@type", "korap:reference");
group.put("operation", "operation:"+operation);
- group.put("classRef", classRefs);
+ if (classRefs!= null && !classRefs.isEmpty()) {
+ group.put("classRef", classRefs);
+ }
return group;
}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
index 5bf42a5..ff0ce02 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusTree.java
@@ -90,7 +90,7 @@
quantGroup.put("boundary", makeBoundary(minmax[0], minmax[1]));
if (minmax[0] != null) quantGroup.put("min", minmax[0]);
if (minmax[1] != null) quantGroup.put("max", minmax[1]);
- announcements.add("Deprecated 2014-07-24: 'min' and 'max' to be supported until 6 months from deprecation date.");
+ announcements.add("Deprecated 2014-07-24: 'min' and 'max' to be supported until 3 months from deprecation date.");
putIntoSuperObject(quantGroup);
objectStack.push(quantGroup);
stackedObjects++;
@@ -312,7 +312,8 @@
// Default is focus(), if deviating catch here
if (type.equals("split")) referenceGroup.put("operation", "operation:split");
if (type.equals("submatch") || type.equals("shrink")) {
- String warning = type + "() is deprecated in favor of focus()";
+ String warning = "Deprecated 2014-07-24: "+type + "() as a match reducer to a specific class is deprecated in " +
+ "favor of focus() and will only be supported for 3 months after deprecation date.";
log.warn(warning);
requestMap.put("warning", warning);
}
@@ -328,9 +329,9 @@
visited.add(node.getChild(0));
}
- if (nodeCat.equals("subspan")) {
- LinkedHashMap<String,Object> subspan = makeReference(null);
- subspan.put("operands", new ArrayList<Object>());
+ if (nodeCat.equals("submatch")) {
+ LinkedHashMap<String,Object> submatch = makeReference(null);
+ submatch.put("operands", new ArrayList<Object>());
ParseTree startpos = getFirstChildWithCat(node,"startpos");
ParseTree length = getFirstChildWithCat(node,"length");
ArrayList<Integer> spanRef = new ArrayList<Integer>();
@@ -338,9 +339,9 @@
if (length != null) {
spanRef.add(Integer.parseInt(length.getText()));
}
- subspan.put("spanRef", spanRef);
- putIntoSuperObject(subspan);
- objectStack.push(subspan);
+ submatch.put("spanRef", spanRef);
+ putIntoSuperObject(submatch);
+ objectStack.push(submatch);
stackedObjects++;
visited.add(node.getChild(0));
}
@@ -671,9 +672,9 @@
"focus(2&3|4:contains({2:<s>},[base=mann]))",
"relatesTo(cnx/c:<s>,<np>)",
"dominates(cnx/c*:<np>,[base=Baum])",
- "subspan(2,3:<s>)"
+ "submatch(2:<np>{2:<s>})"
};
- PoliqarpPlusTree.verbose=true;
+// PoliqarpPlusTree.verbose=true;
for (String q : queries) {
try {
System.out.println(q);
diff --git a/src/test/java/PoliqarpPlusTreeTest.java b/src/test/java/PoliqarpPlusTreeTest.java
index 4f835fb..046c374 100644
--- a/src/test/java/PoliqarpPlusTreeTest.java
+++ b/src/test/java/PoliqarpPlusTreeTest.java
@@ -1149,7 +1149,7 @@
@Test
public void testSubspan() throws QueryException {
- query = "subspan(1:<s>)";
+ query = "submatch(1,:<s>)";
expected =
"{@type=korap:reference, operation=operation:focus, operands=[" +
"{@type=korap:span, key=s}" +
@@ -1159,7 +1159,7 @@
map = ppt.getRequestMap().get("query").toString();
assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
- query = "subspan(1,4:<s>)";
+ query = "submatch(1,4:<s>)";
expected =
"{@type=korap:reference, operation=operation:focus, operands=[" +
"{@type=korap:span, key=s}" +
@@ -1169,7 +1169,7 @@
map = ppt.getRequestMap().get("query").toString();
assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", ""));
- query = "subspan(1,4:contains(<s>,[base=Haus]))";
+ query = "submatch(1,4:contains(<s>,[base=Haus]))";
expected =
"{@type=korap:reference, operation=operation:focus, operands=[" +
"{@type=korap:group, operation=operation:position, frame=frame:contains, operands=[" +