- no-highlight classes > 128
- code cleanup
diff --git a/.gitignore b/.gitignore
index 56fb75b..714609d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,3 +64,5 @@
# /src/main/java/de/ids_mannheim/korap/query/serialize/
/src/main/java/de/ids_mannheim/korap/query/serialize/SerializationSandbox.java
+/lib/
+/bin/
diff --git a/pom.xml b/pom.xml
index 0c2ec69..4e1eac4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,125 +102,127 @@
</dependencies>
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
- <outputDirectory>${basedir}/bin</outputDirectory>
- <plugins>
- <!-- Formatter plugin for Eclipse based coding conventions http://maven-java-formatter-plugin.googlecode.com/svn/site/0.4/usage.html -->
- <plugin>
- <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
- <artifactId>maven-java-formatter-plugin</artifactId>
- <version>0.4</version>
- <configuration>
- <configFile>${project.basedir}/korap-style.xml</configFile>
- <overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
- <compilerSource>1.7</compilerSource>
- <compilerCompliance>1.7</compilerCompliance>
- <compilerTargetPlatform>1.7</compilerTargetPlatform>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <phase>install</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/../lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.5</version>
- <configuration>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>../lib/</classpathPrefix>
- <mainClass>de.ids_mannheim.korap.query.serialize.QuerySerializer</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <!-- This plugin will help to build the ANTLR4 grammar on the fly. The
- recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-maven-plugin</artifactId>
- <version>4.1</version>
- <executions>
- <execution>
- <id>poliqarpplus</id>
- <goals>
- <goal>antlr4</goal>
- </goals>
- <configuration>
- <sourceDirectory>${basedir}/src/main/antlr/poliqarpplus</sourceDirectory>
- <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/poliqarpplus</outputDirectory>
- <libDirectory>${basedir}/src/main/antlr/poliqarpplus</libDirectory>
- </configuration>
- <phase>generate-sources</phase>
- </execution>
- <execution>
- <id>annis</id>
- <goals>
- <goal>antlr4</goal>
- </goals>
- <configuration>
- <sourceDirectory>${basedir}/src/main/antlr/annis</sourceDirectory>
- <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/annis</outputDirectory>
- <libDirectory>${basedir}/src/main/antlr/annis</libDirectory>
- </configuration>
- <phase>generate-sources</phase>
- </execution>
- <execution>
- <id>collection</id>
- <goals>
- <goal>antlr4</goal>
- </goals>
- <configuration>
- <sourceDirectory>${basedir}/src/main/antlr/collection</sourceDirectory>
- <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/collection</outputDirectory>
- <libDirectory>${basedir}/src/main/antlr/collection</libDirectory>
- </configuration>
- <phase>generate-sources</phase>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <!-- This plugin will help to build the ANTLR3 grammar on the fly. The
- recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
- <groupId>org.antlr</groupId>
- <artifactId>antlr3-maven-plugin</artifactId>
- <version>3.5.1</version>
- <configuration>
- <sourceDirectory>${basedir}/src/main/antlr/cosmas</sourceDirectory>
- <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/cosmas</outputDirectory>
- <libDirectory>${basedir}/src/main/antlr</libDirectory>
- </configuration>
+ <outputDirectory>${basedir}/target/classes</outputDirectory>
+ <pluginManagement>
+ <plugins>
+ <!-- Formatter plugin for Eclipse based coding conventions http://maven-java-formatter-plugin.googlecode.com/svn/site/0.4/usage.html -->
+ <plugin>
+ <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
+ <artifactId>maven-java-formatter-plugin</artifactId>
+ <version>0.4</version>
+ <configuration>
+ <configFile>${project.basedir}/korap-style.xml</configFile>
+ <overrideConfigCompilerVersion>true</overrideConfigCompilerVersion>
+ <compilerSource>1.7</compilerSource>
+ <compilerCompliance>1.7</compilerCompliance>
+ <compilerTargetPlatform>1.7</compilerTargetPlatform>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>install</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/../lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>de.ids_mannheim.korap.query.serialize.QuerySerializer</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <!-- This plugin will help to build the ANTLR4 grammar on the fly. The
+ recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-maven-plugin</artifactId>
+ <version>4.1</version>
+ <executions>
+ <execution>
+ <id>poliqarpplus</id>
+ <goals>
+ <goal>antlr4</goal>
+ </goals>
+ <configuration>
+ <sourceDirectory>${basedir}/src/main/antlr/poliqarpplus</sourceDirectory>
+ <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/poliqarpplus</outputDirectory>
+ <libDirectory>${basedir}/src/main/antlr/poliqarpplus</libDirectory>
+ </configuration>
+ <phase>generate-sources</phase>
+ </execution>
+ <execution>
+ <id>annis</id>
+ <goals>
+ <goal>antlr4</goal>
+ </goals>
+ <configuration>
+ <sourceDirectory>${basedir}/src/main/antlr/annis</sourceDirectory>
+ <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/annis</outputDirectory>
+ <libDirectory>${basedir}/src/main/antlr/annis</libDirectory>
+ </configuration>
+ <phase>generate-sources</phase>
+ </execution>
+ <execution>
+ <id>collection</id>
+ <goals>
+ <goal>antlr4</goal>
+ </goals>
+ <configuration>
+ <sourceDirectory>${basedir}/src/main/antlr/collection</sourceDirectory>
+ <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/collection</outputDirectory>
+ <libDirectory>${basedir}/src/main/antlr/collection</libDirectory>
+ </configuration>
+ <phase>generate-sources</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- This plugin will help to build the ANTLR3 grammar on the fly. The
+ recipe is based on http://stackoverflow.com/questions/15310628/ customize-maven-to-automatically-create-antlr4-grammar-java-files-on-build -->
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr3-maven-plugin</artifactId>
+ <version>3.5.1</version>
+ <configuration>
+ <sourceDirectory>${basedir}/src/main/antlr/cosmas</sourceDirectory>
+ <outputDirectory>${basedir}/src/main/java/de/ids_mannheim/korap/query/parse/cosmas</outputDirectory>
+ <libDirectory>${basedir}/src/main/antlr</libDirectory>
+ </configuration>
- <executions>
- <execution>
- <goals>
- <goal>antlr</goal>
- </goals>
- <phase>generate-sources</phase>
- </execution>
- </executions>
+ <executions>
+ <execution>
+ <goals>
+ <goal>antlr</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ </execution>
+ </executions>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- <!-- excludes> <exclude>**/CosmasTree.java</exclude> </excludes -->
- </configuration>
- </plugin>
- </plugins>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ <!-- excludes> <exclude>**/CosmasTree.java</exclude> </excludes -->
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
</project>
diff --git a/src/main/java/.gitignore b/src/main/java/.gitignore
new file mode 100644
index 0000000..688761c
--- /dev/null
+++ b/src/main/java/.gitignore
@@ -0,0 +1 @@
+/SerializationSandbox.java
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/.gitignore b/src/main/java/de/ids_mannheim/korap/query/parse/.gitignore
new file mode 100644
index 0000000..e92a46d
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/.gitignore
@@ -0,0 +1,3 @@
+/annis/
+/collection/
+/poliqarpplus/
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opAnnot.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opAnnot.java
index 4bb62a2..593988d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opAnnot.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opAnnot.java
@@ -1,10 +1,5 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
-import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
-import org.antlr.runtime.tree.*;
-
/* COSMAS II Plain Syntax (c2ps).
* lokale Grammatik für Optionen von #IN(Opts).
* 12.12.12/FB
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opBED.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opBED.java
index a6dc19b..713c289 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opBED.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opBED.java
@@ -1,8 +1,6 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.tree.*;
// parses Opts in #BED(x,Opts):
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opELEM.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opELEM.java
index 9968e24..2e0c55c 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opELEM.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opELEM.java
@@ -1,8 +1,6 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.tree.*;
// parses Search Expression inside #ELEM(...):
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opIN.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opIN.java
index 7d50a90..53f6429 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opIN.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opIN.java
@@ -1,8 +1,6 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.tree.*;
/* COSMAS II Plain Syntax (c2ps).
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opOV.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opOV.java
index c47160c..27cd9de 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opOV.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opOV.java
@@ -1,8 +1,6 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.tree.*;
/* COSMAS II Plain Syntax (c2ps).
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opPROX.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opPROX.java
index 4d8561d..12d8fa4 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opPROX.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opPROX.java
@@ -1,8 +1,6 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.tree.*;
/*
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opWF.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opWF.java
index 5400bec..7cdac48 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opWF.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_opWF.java
@@ -1,8 +1,6 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.tree.*;
/*
diff --git a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_optCase.java b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_optCase.java
index 8f1ad28..8a971d6 100644
--- a/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_optCase.java
+++ b/src/main/java/de/ids_mannheim/korap/query/parse/cosmas/c2ps_optCase.java
@@ -1,8 +1,6 @@
package de.ids_mannheim.korap.query.parse.cosmas;
-import java.io.*;
import org.antlr.runtime.*;
-import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.tree.*;
// parses Case Options.
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
index 8e41b38..c8cc39f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessor.java
@@ -352,7 +352,7 @@
"TPEND");
LinkedHashMap<String, Object> submatchgroup =
- KoralObjectGenerator.makeReference(classCounter);
+ KoralObjectGenerator.makeReference(classCounter+128);
ArrayList<Object> submatchOperands = new ArrayList<Object>();
submatchgroup.put("operands", submatchOperands);
putIntoSuperObject(submatchgroup);
@@ -397,7 +397,7 @@
// constraint applies
if (conditionCount > 1) {
LinkedHashMap<String, Object> focus =
- KoralObjectGenerator.makeReference(classCounter - 2);
+ KoralObjectGenerator.makeReference(classCounter +128 - 2);
ArrayList<Object> focusOperands = new ArrayList<Object>();
focus.put("operands", focusOperands);
focusOperands.add(matchesGroup);
@@ -415,22 +415,22 @@
}
private void processOPNHIT(Tree node) {
- Integer[] classRef = new Integer[] { classCounter + 1,
- classCounter + 2 };
+ Integer[] classRef = new Integer[] { classCounter + 128 + 1,
+ classCounter + 128 + 2 };
// classRef.add(classCounter + 1); // yes, do this twice (two
// classes)!
LinkedHashMap<String, Object> group =
- KoralObjectGenerator.makeReference(classCounter);
+ KoralObjectGenerator.makeReference(classCounter+128);
LinkedHashMap<String, Object> classRefCheck =
KoralObjectGenerator.makeClassRefOp("classRefOp:inversion", classRef,
- classCounter);
+ classCounter+128);
ArrayList<Object> operands = new ArrayList<Object>();
operands.add(classRefCheck);
group.put("operands", operands);
classCounter++;
// direct child is OPPROX
- wrapOperandInClass(node.getChild(0), 1, classCounter++);
- wrapOperandInClass(node.getChild(0), 2, classCounter++);
+ wrapOperandInClass(node.getChild(0), 1, 128+classCounter++);
+ wrapOperandInClass(node.getChild(0), 2, 128+classCounter++);
objectStack.push(classRefCheck);
stackedObjects++;
putIntoSuperObject(group, 1);
@@ -457,8 +457,8 @@
private void processOPIN_OPOV(Tree node) {
// Step I: create group
String nodeCat = getNodeCat(node);
- wrapOperandInClass(node, 2, classCounter++);
- wrapOperandInClass(node, 1, classCounter++);
+ wrapOperandInClass(node, 2, 128+classCounter++);
+ wrapOperandInClass(node, 1, 128+classCounter++);
// LinkedHashMap<String, Object> posgroup =
// makePosition(null);
LinkedHashMap<String, Object> posGroup = KoralObjectGenerator
@@ -484,13 +484,13 @@
ArrayList<String> check =
(ArrayList<String>) positionOptions.get("classRefCheck");
Integer[] classIn =
- new Integer[] { classCounter - 2, classCounter - 1 };
+ new Integer[] { classCounter+128-2, classCounter+128-1 };
LinkedHashMap<String, Object> topGroup;
if (! check.isEmpty()) {
// wrap position in a classRefCheck
topGroup =
KoralObjectGenerator.makeClassRefCheck(check, classIn,
- classCounter);
+ classCounter+128);
((ArrayList<Object>) topGroup.get("operands")).add(posGroup);
} else {
topGroup = posGroup;
@@ -498,12 +498,12 @@
LinkedHashMap<String, Object> focusGroup = null;
if ((boolean) positionOptions.get("matchall") == true) {
focusGroup = KoralObjectGenerator.makeClassRefOp("classRefOp:delete",
- new Integer[]{classCounter++}, classCounter);
+ new Integer[]{128+classCounter++}, 128+classCounter);
((ArrayList<Object>) focusGroup.get("operands")).add(topGroup);
}
else { // match only first argument
focusGroup = KoralObjectGenerator.wrapInReference(topGroup,
- classCounter-1);
+ classCounter+128-1);
classCounter++;
}
// wrap in 'merge' operation if grouping option is set
@@ -599,8 +599,10 @@
|| openNodeCats.get(1).equals("OPEND")
|| inOPALL
|| openNodeCats.get(1).equals("OPNHIT"))) {
- wrapOperandInClass(node, 1, classCounter);
- wrapOperandInClass(node, 2, classCounter);
+ System.err.println(classCounter);
+ wrapOperandInClass(node, 1, 128+classCounter);
+ wrapOperandInClass(node, 2, 128+classCounter);
+ System.err.println(classCounter);
// Deactivated, uncomment to wrap sequence in reference.
// group = KoralObjectGenerator.wrapInReference(group,
// classCounter++);
@@ -1040,7 +1042,7 @@
positionGroup.put("exclude", true);
ArrayList<Object> posOperands = new ArrayList<Object>();
LinkedHashMap<String, Object> classGroup =
- KoralObjectGenerator.makeSpanClass(classCounter++);
+ KoralObjectGenerator.makeSpanClass(128+classCounter++);
classGroup.put("operands", distributedOperands);
positionGroup.put("operands", posOperands);
LinkedHashMap<String, Object> span = new LinkedHashMap<String, Object>();
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
index 23958fa..b07d0f9 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
@@ -454,8 +454,9 @@
catch (NumberFormatException e) {
String msg = "The specified class reference in the "
+ "focus/split-Operator is not a number: " + ref;
+ classId = 0;
log.error(msg);
- addError(StatusCodes.UNDEFINED_CLASS_REFERENCE, msg);
+ addError(StatusCodes.INVALID_CLASS_REFERENCE, msg);
}
// only allow class id up to 127
if (classId > 128) {
@@ -464,7 +465,7 @@
+ "Check for possible conflict with other classes.");
classId = 128;
}
- }
+ }
LinkedHashMap<String, Object> classGroup =
KoralObjectGenerator.makeSpanClass(classId);
addHighlightClass(classId);
@@ -502,13 +503,13 @@
catch (NumberFormatException e) {
String err = "The specified class reference in the "
+ "shrink/split-Operator is not a number.";
- addError(StatusCodes.UNDEFINED_CLASS_REFERENCE, err);
+ addError(StatusCodes.INVALID_CLASS_REFERENCE, err);
}
}
}
}
else {
- classRefs.add(1);
+ classRefs.add(1); // default
}
LinkedHashMap<String, Object> referenceGroup =
KoralObjectGenerator.makeReference(classRefs);
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
index 610c83e..8fdf565 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/util/KoralObjectGenerator.java
@@ -114,12 +114,7 @@
+ "your query for later reference to a part of the query. The class id is "
+ classId);
}
- group.put("class", classId);
group.put("classOut", classId);
- qp.addMessage(
- StatusCodes.DEPRECATED_QUERY_ELEMENT,
- "Deprecated 2014-10-07: 'class' only to be supported until 3 months from deprecation date. "
- + "Classes are now defined using the 'classOut' attribute.");
group.put("operands", new ArrayList<Object>());
return group;
}
@@ -132,11 +127,6 @@
group.put("classRefCheck", check);
group.put("classIn", Arrays.asList(classIn));
group.put("classOut", classOut);
- group.put("class", classOut);
- qp.addMessage(
- StatusCodes.DEPRECATED_QUERY_ELEMENT,
- "Deprecated 2014-10-07: 'class' only to be supported until 3 months from deprecation date. "
- + "Classes are now defined using the 'classOut' attribute.");
group.put("operands", new ArrayList<Object>());
return group;
}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java b/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
index 6416b0e..993ba38 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/util/StatusCodes.java
@@ -4,7 +4,7 @@
public final static int NO_QUERY = 301;
public final static int MALFORMED_QUERY = 302;
public final static int DEPRECATED_QUERY_ELEMENT = 303;
- public final static int UNDEFINED_CLASS_REFERENCE = 304;
+ public final static int INVALID_CLASS_REFERENCE = 304;
public final static int INCOMPATIBLE_OPERATOR_AND_OPERAND = 305;
public final static int UNKNOWN_QUERY_ELEMENT = 306;
public final static int UNKNOWN_QL = 307;
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java
index 4c04ed9..82020db 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/Cosmas2QueryProcessorTest.java
@@ -407,8 +407,8 @@
assertEquals(true, res.at("/query/inOrder").asBoolean());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
- assertEquals(1, res.at("/query/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("Sonne", res.at("/query/operands/0/operands/0/wrap/key").asText());
assertEquals("Mond", res.at("/query/operands/1/operands/0/wrap/key").asText());
@@ -430,8 +430,8 @@
assertEquals(true, res.at("/query/inOrder").asBoolean());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
- assertEquals(1, res.at("/query/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("Sonne", res.at("/query/operands/0/operands/0/wrap/key").asText());
assertEquals("Mond", res.at("/query/operands/1/operands/0/wrap/key").asText());
@@ -480,16 +480,16 @@
assertEquals(true, res.at("/query/inOrder").asBoolean());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
assertEquals("Sonne", res.at("/query/operands/0/operands/0/wrap/key").asText());
- assertEquals(1, res.at("/query/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/1/classOut").asInt());
assertEquals("operation:sequence", res.at("/query/operands/1/operands/0/operation").asText());
assertEquals("w", res.at("/query/operands/1/operands/0/distances/0/key").asText());
assertEquals(1, res.at("/query/operands/1/operands/0/distances/0/boundary/min").asInt());
assertEquals(7, res.at("/query/operands/1/operands/0/distances/0/boundary/max").asInt());
- assertEquals(2, res.at("/query/operands/1/operands/0/operands/0/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/1/operands/0/operands/0/classOut").asInt());
assertEquals("Mond", res.at("/query/operands/1/operands/0/operands/0/operands/0/wrap/key").asText());
- assertEquals(2, res.at("/query/operands/1/operands/0/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/1/operands/0/operands/1/classOut").asInt());
assertEquals("Sterne", res.at("/query/operands/1/operands/0/operands/1/operands/0/wrap/key").asText());
query = "Sonne /+w1:4 Mond /-w1:7 Sterne";
@@ -511,16 +511,16 @@
assertEquals(true, res.at("/query/inOrder").asBoolean());
assertEquals("korap:group", res.at("/query/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/1/classOut").asInt());
assertEquals("Sonne", res.at("/query/operands/1/operands/0/wrap/key").asText());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
assertEquals("operation:sequence", res.at("/query/operands/0/operands/0/operation").asText());
assertEquals("w", res.at("/query/operands/0/operands/0/distances/0/key").asText());
assertEquals(0, res.at("/query/operands/0/operands/0/distances/0/boundary/min").asInt());
assertEquals(2, res.at("/query/operands/0/operands/0/distances/0/boundary/max").asInt());
- assertEquals(2, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
assertEquals("Mond", res.at("/query/operands/0/operands/0/operands/0/operands/0/wrap/key").asText());
- assertEquals(2, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("Sterne", res.at("/query/operands/0/operands/0/operands/1/operands/0/wrap/key").asText());
}
@@ -532,24 +532,24 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(2, res.at("/query/classRef/0").asInt());
+ assertEquals(130, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
assertEquals("classRefCheck:includes", res.at("/query/operands/0/classRefCheck/0").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operands/0/operation").asText());
assertEquals(true, res.at("/query/operands/0/operands/0/frames/0").isMissingNode());
- assertEquals(1, res.at("/query/operands/0/classIn/0").asInt());
- assertEquals(2, res.at("/query/operands/0/classIn/1").asInt());
- assertEquals(3, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classIn/0").asInt());
+ assertEquals(130, res.at("/query/operands/0/classIn/1").asInt());
+ assertEquals(131, res.at("/query/operands/0/classOut").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
assertEquals("korap:span", res.at("/query/operands/0/operands/0/operands/0/operands/0/@type").asText());
assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/1/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/0/operands/1/operands/0/@type").asText());
assertEquals("wegen", res.at("/query/operands/0/operands/0/operands/1/operands/0/wrap/key").asText());
@@ -558,7 +558,7 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(2, res.at("/query/classRef/0").asInt());
+ assertEquals(130, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operation").asText());
assertEquals("frames:startsWith", res.at("/query/operands/0/frames/0").asText());
@@ -566,12 +566,12 @@
assertEquals(true, res.at("/query/operands/0/frames/2").isMissingNode());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/0/classOut").asInt());
assertEquals("korap:span", res.at("/query/operands/0/operands/0/operands/0/@type").asText());
assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/1/operands/0/@type").asText());
assertEquals("wegen", res.at("/query/operands/0/operands/1/operands/0/wrap/key").asText());
@@ -615,7 +615,7 @@
res = mapper.readTree(qs.toJSON());
assertEquals("operation:class", res.at("/query/operation").asText());
assertEquals("classRefOp:delete", res.at("/query/classRefOp").asText());
- assertEquals(3, res.at("/query/classIn/0").asInt());
+ assertEquals(131, res.at("/query/classIn/0").asInt());
assertEquals("classRefCheck:equals", res.at("/query/operands/0/classRefCheck/0").asText());
assertEquals("frames:matches", res.at("/query/operands/0/operands/0/frames/0").asText());
assertEquals(true, res.at("/query/operands/0/operands/0/exclude").asBoolean());
@@ -626,7 +626,7 @@
assertEquals("operation:merge", res.at("/query/operation").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
assertEquals("classRefOp:delete", res.at("/query/operands/0/classRefOp").asText());
- assertEquals(3, res.at("/query/operands/0/classIn/0").asInt());
+ assertEquals(131, res.at("/query/operands/0/classIn/0").asInt());
assertEquals("classRefCheck:equals", res.at("/query/operands/0/operands/0/classRefCheck/0").asText());
assertEquals("frames:matches", res.at("/query/operands/0/operands/0/operands/0/frames/0").asText());
assertEquals(true, res.at("/query/operands/0/operands/0/operands/0/exclude").asBoolean());
@@ -639,25 +639,25 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(2, res.at("/query/classRef/0").asInt());
+ assertEquals(130, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
assertEquals("classRefCheck:intersects", res.at("/query/operands/0/classRefCheck/0").asText());
// assertEquals("classRefOp:merge", res.at("/query/operands/0/classRefOp").asText());
- assertEquals(3, res.at("/query/operands/0/classOut").asInt());
- assertEquals(1, res.at("/query/operands/0/classIn/0").asInt());
- assertEquals(2, res.at("/query/operands/0/classIn/1").asInt());
+ assertEquals(131, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classIn/0").asInt());
+ assertEquals(130, res.at("/query/operands/0/classIn/1").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operands/0/operation").asText());
assertEquals(true, res.at("/query/operands/0/operands/0/frames/0").isMissingNode());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
assertEquals("korap:span", res.at("/query/operands/0/operands/0/operands/0/operands/0/@type").asText());
assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/1/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/0/operands/1/operands/0/@type").asText());
assertEquals("wegen", res.at("/query/operands/0/operands/0/operands/1/operands/0/wrap/key").asText());
@@ -722,7 +722,7 @@
assertEquals(true, res.at("/query/inOrder").asBoolean());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
assertEquals("korap:reference", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("operation:focus", res.at("/query/operands/0/operands/0/operation").asText());
assertEquals(0, res.at("/query/operands/0/operands/0/spanRef/0").asInt());
@@ -738,7 +738,7 @@
assertEquals("der", res.at("/query/operands/0/operands/0/operands/0/operands/0/wrap/key").asText());
assertEquals("Mann", res.at("/query/operands/0/operands/0/operands/0/operands/1/wrap/key").asText());
assertEquals("operation:class", res.at("/query/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/1/operands/0/@type").asText());
assertEquals("kommt", res.at("/query/operands/1/operands/0/wrap/key").asText());
@@ -754,7 +754,7 @@
assertEquals(true, res.at("/query/inOrder").asBoolean());
assertEquals("korap:group", res.at("/query/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/1/classOut").asInt());
assertEquals("korap:reference", res.at("/query/operands/1/operands/0/@type").asText());
assertEquals("operation:focus", res.at("/query/operands/1/operands/0/operation").asText());
assertEquals(0, res.at("/query/operands/1/operands/0/spanRef/0").asInt());
@@ -770,7 +770,7 @@
assertEquals("der", res.at("/query/operands/1/operands/0/operands/0/operands/0/wrap/key").asText());
assertEquals("Mann", res.at("/query/operands/1/operands/0/operands/0/operands/1/wrap/key").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("kommt", res.at("/query/operands/0/operands/0/wrap/key").asText());
@@ -906,13 +906,13 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
assertEquals("classRefOp:inversion",res.at("/query/operands/0/classRefOp").asText());
- assertEquals(2, res.at("/query/operands/0/classIn/0").asInt());
- assertEquals(3, res.at("/query/operands/0/classIn/1").asInt());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/classIn/0").asInt());
+ assertEquals(131, res.at("/query/operands/0/classIn/1").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("operation:sequence", res.at("/query/operands/0/operands/0/operation").asText());
assertEquals("korap:distance", res.at("/query/operands/0/operands/0/distances/0/@type").asText());
@@ -921,8 +921,8 @@
assertEquals(10, res.at("/query/operands/0/operands/0/distances/0/boundary/max").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/0/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
- assertEquals(3, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
+ assertEquals(131, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/0/operands/0/operands/0/@type").asText());
assertEquals("gehen", res.at("/query/operands/0/operands/0/operands/0/operands/0/wrap/key").asText());
assertEquals("voran", res.at("/query/operands/0/operands/0/operands/1/operands/0/wrap/key").asText());
@@ -932,13 +932,13 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
assertEquals("classRefOp:inversion",res.at("/query/operands/0/classRefOp").asText());
- assertEquals(2, res.at("/query/operands/0/classIn/0").asInt());
- assertEquals(3, res.at("/query/operands/0/classIn/1").asInt());
- assertEquals(1, res.at("/query/operands/0/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/classIn/0").asInt());
+ assertEquals(131, res.at("/query/operands/0/classIn/1").asInt());
+ assertEquals(129, res.at("/query/operands/0/classOut").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/@type").asText());
assertEquals("operation:sequence", res.at("/query/operands/0/operands/0/operation").asText());
assertEquals("korap:distance", res.at("/query/operands/0/operands/0/distances/0/@type").asText());
@@ -947,14 +947,14 @@
assertEquals(10, res.at("/query/operands/0/operands/0/distances/0/boundary/max").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/0/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/0/operands/0/classOut").asInt());
assertEquals("gehen", res.at("/query/operands/0/operands/0/operands/0/operands/0/wrap/key").asText());
- assertEquals(3, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(131, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
// assertEquals("classRefOp:merge", res.at("/query/operands/0/operands/0/operands/1/classRefOp").asText());
assertEquals("operation:sequence", res.at("/query/operands/0/operands/0/operands/1/operands/0/operation").asText());
- assertEquals(4, res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/0/classOut").asInt());
+ assertEquals(132, res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/0/classOut").asInt());
assertEquals("voran", res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/0/operands/0/wrap/key").asText());
- assertEquals(4, res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/1/classOut").asInt());
+ assertEquals(132, res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/1/classOut").asInt());
assertEquals("Beispiel", res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/1/operands/0/wrap/key").asText());
}
@@ -966,13 +966,13 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operation").asText());
assertEquals("frames:startsWith", res.at("/query/operands/0/frames/0").asText());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/1/operands/0/@type").asText());
assertEquals("der", res.at("/query/operands/0/operands/1/operands/0/wrap/key").asText());
assertEquals("korap:span", res.at("/query/operands/0/operands/0/@type").asText());
@@ -983,7 +983,7 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operation").asText());
assertEquals("frames:matches", res.at("/query/operands/0/frames/0").asText());
@@ -999,7 +999,7 @@
assertEquals(1, res.at("/query/operands/0/operands/1/spanRef/1").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operands/0/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/1/operands/0/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/1/operands/0/classOut").asInt());
assertEquals("operation:sequence", res.at("/query/operands/0/operands/1/operands/0/operands/0/operation").asText());
assertEquals("der", res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/0/wrap/key").asText());
assertEquals("Mann", res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/1/wrap/key").asText());
@@ -1009,7 +1009,7 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operation").asText());
assertEquals("frames:matches", res.at("/query/operands/0/frames/0").asText());
@@ -1021,7 +1021,7 @@
assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("operation:sequence", res.at("/query/operands/0/operands/0/operands/1/operands/0/operation").asText());
assertEquals("der", res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/0/wrap/key").asText());
assertEquals("Mann", res.at("/query/operands/0/operands/0/operands/1/operands/0/operands/1/wrap/key").asText());
@@ -1034,7 +1034,7 @@
assertEquals("p", res.at("/query/operands/0/operands/1/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operands/1/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/1/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/1/operands/1/classOut").asInt());
assertEquals("operation:sequence", res.at("/query/operands/0/operands/1/operands/1/operands/0/operation").asText());
assertEquals("der", res.at("/query/operands/0/operands/1/operands/1/operands/0/operands/0/wrap/key").asText());
assertEquals("Mann", res.at("/query/operands/0/operands/1/operands/1/operands/0/operands/1/wrap/key").asText());
@@ -1048,13 +1048,13 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operation").asText());
assertEquals("frames:startsWith", res.at("/query/operands/0/frames/0").asText());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/1/classOut").asInt());
assertEquals("korap:token", res.at("/query/operands/0/operands/1/operands/0/@type").asText());
assertEquals("der", res.at("/query/operands/0/operands/1/operands/0/wrap/key").asText());
assertEquals("korap:span", res.at("/query/operands/0/operands/0/@type").asText());
@@ -1065,7 +1065,7 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operation").asText());
assertEquals("frames:matches", res.at("/query/operands/0/frames/0").asText());
@@ -1076,7 +1076,7 @@
assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("der", res.at("/query/operands/0/operands/0/operands/1/operands/0/wrap/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operands/1/operation").asText());
@@ -1086,7 +1086,7 @@
assertEquals("p", res.at("/query/operands/0/operands/1/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operands/1/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/1/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/1/operands/1/classOut").asInt());
assertEquals("der", res.at("/query/operands/0/operands/1/operands/1/operands/0/wrap/key").asText());
query = "der:sa,-pa,+te";
@@ -1094,7 +1094,7 @@
res = mapper.readTree(qs.toJSON());
assertEquals("korap:reference", res.at("/query/@type").asText());
assertEquals("operation:focus", res.at("/query/operation").asText());
- assertEquals(1, res.at("/query/classRef/0").asInt());
+ assertEquals(129, res.at("/query/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operation").asText());
assertEquals("frames:matches", res.at("/query/operands/0/frames/0").asText());
@@ -1105,11 +1105,11 @@
assertEquals("s", res.at("/query/operands/0/operands/0/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/0/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/0/operands/1/operation").asText());
- assertEquals(1, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(129, res.at("/query/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("der", res.at("/query/operands/0/operands/0/operands/1/operands/0/wrap/key").asText());
assertEquals("korap:reference", res.at("/query/operands/0/operands/1/@type").asText());
assertEquals("operation:focus", res.at("/query/operands/0/operands/1/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/1/classRef/0").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/1/classRef/0").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/operands/0/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operands/1/operands/0/operation").asText());
assertEquals("frames:matches", res.at("/query/operands/0/operands/1/operands/0/frames/0").asText());
@@ -1121,7 +1121,7 @@
assertEquals("p", res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/0/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/1/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/1/operation").asText());
- assertEquals(2, res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/1/classOut").asInt());
+ assertEquals(130, res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/1/classOut").asInt());
assertEquals("der", res.at("/query/operands/0/operands/1/operands/0/operands/0/operands/1/operands/0/wrap/key").asText());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/operands/0/operands/1/@type").asText());
assertEquals("operation:position", res.at("/query/operands/0/operands/1/operands/0/operands/1/operation").asText());
@@ -1138,7 +1138,7 @@
assertEquals(1, res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/1/spanRef/1").asInt());
assertEquals("korap:group", res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/1/operands/0/@type").asText());
assertEquals("operation:class", res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/1/operands/0/operation").asText());
- assertEquals(3, res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/1/operands/0/classOut").asInt());
+ assertEquals(131, res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/1/operands/0/classOut").asInt());
assertEquals("der", res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/1/operands/0/operands/0/wrap/key").asText());
}
@@ -1165,4 +1165,4 @@
assertEquals(StatusCodes.MALFORMED_QUERY, res.at("/errors/0/0").asInt());
assertTrue(res.at("/errors/0/1").asText().startsWith("Early closing parenthesis"));
}
-}
\ No newline at end of file
+}
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
index 8344d2c..f9cdf16 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
@@ -958,6 +958,19 @@
assertEquals("Mann", res.at("/query/operands/0/operands/0/wrap/key").asText());
assertEquals("Frau", res.at("/query/operands/0/operands/1/wrap/key").asText());
+ query = "{[base=Mann]}{[orth=Frau]}";
+ qs.setQuery(query, "poliqarpplus");
+ res = mapper.readTree(qs.toJSON());
+ assertEquals("korap:group", res.at("/query/@type").asText());
+ assertEquals("operation:sequence", res.at("/query/operation").asText());
+ assertEquals("operation:class", res.at("/query/operands/0/operation").asText());
+ assertEquals(1, res.at("/query/operands/0/classOut").asInt());
+ assertEquals("operation:class", res.at("/query/operands/1/operation").asText());
+ assertEquals(1, res.at("/query/operands/1/classOut").asInt());
+ assertEquals(true, res.at("/query/classIn").isMissingNode());
+ assertEquals("Mann", res.at("/query/operands/0/operands/0/wrap/key").asText());
+ assertEquals("Frau", res.at("/query/operands/1/operands/0/wrap/key").asText());
+
query = "[p=NN]{[base=Mann][orth=Frau]}";
qs.setQuery(query, "poliqarpplus");
res = mapper.readTree(qs.toJSON());