no classes with classId 0
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 5418c09..397ee5f 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
@@ -298,7 +298,7 @@
if (nodeCat.equals("spanclass")) {
// Step I: get info
- int classId = 0;
+ int classId = 1;
if (getNodeCat(node.getChild(1)).equals("spanclass_id")) {
String ref = node.getChild(1).getChild(0).toStringTree(parser);
try {
@@ -311,7 +311,7 @@
}
// only allow class id up to 255
if (classId > 255) {
- classId = 0;
+ classId = 1;
}
}
LinkedHashMap<String, Object> classGroup = makeSpanClass(classId, false);
@@ -343,7 +343,7 @@
}
}
} else {
- classRefs.add(0);
+ classRefs.add(1);
}
LinkedHashMap<String, Object> referenceGroup = makeReference(classRefs);
diff --git a/src/test/java/PoliqarpPlusTreeTest.java b/src/test/java/PoliqarpPlusTreeTest.java
index 27e4fca..3f87c21 100644
--- a/src/test/java/PoliqarpPlusTreeTest.java
+++ b/src/test/java/PoliqarpPlusTreeTest.java
@@ -873,7 +873,7 @@
public void testClasses() throws QueryException {
String query;
// {[base=Mann]}
- String cls1 = "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
+ String cls1 = "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}" +
"]}";
ppt = new PoliqarpPlusTree("{[base=Mann]}");
@@ -882,7 +882,7 @@
// {[base=Mann][orth=Frau]}
query = "{[base=Mann][orth=Frau]}";
- String cls2 = "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
+ String cls2 = "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
"{@type=korap:group, operation=operation:sequence, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
@@ -895,7 +895,7 @@
// [p=NN]{[base=Mann][orth=Frau]}
String cls3 = "{@type=korap:group, operation=operation:sequence, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=p, key=NN, match=match:eq}}," +
- "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
+ "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
"{@type=korap:group, operation=operation:sequence, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
@@ -908,7 +908,7 @@
// {[base=Mann][orth=Frau]}[p=NN]
String cls4 = "{@type=korap:group, operation=operation:sequence, operands=[" +
- "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
+ "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
"{@type=korap:group, operation=operation:sequence, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Mann, match=match:eq}}," +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Frau, match=match:eq}}" +
@@ -1025,10 +1025,10 @@
public void testFocusSplit() throws QueryException {
// focus([orth=Der]{[orth=Mann]})
String shr1 =
- "{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
+ "{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
"{@type=korap:group, operation=operation:sequence, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
- "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
+ "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}" +
"]}" +
"]}" +
@@ -1039,10 +1039,10 @@
// focus([orth=Der]{[orth=Mann][orth=geht]})
String shr2 =
- "{@type=korap:reference, operation=operation:focus, classRef=[0], operands=[" +
+ "{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
"{@type=korap:group, operation=operation:sequence, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Der, match=match:eq}}," +
- "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
+ "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
"{@type=korap:group, operation=operation:sequence, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Mann, match=match:eq}}," +
"{@type=korap:token, wrap={@type=korap:term, layer=orth, key=geht, match=match:eq}}" +
@@ -1161,7 +1161,7 @@
String shr8 =
"{@type=korap:reference, operation=operation:focus, classRef=[1], operands=[" +
"{@type=korap:group, operation=operation:sequence, operands=[" +
- "{@type=korap:group, operation=operation:class, class=0, classOut=0, operands=[" +
+ "{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +
"{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=der, match=match:eq}}" +
"]}," +
"{@type=korap:group, operation=operation:class, class=1, classOut=1, operands=[" +