meta query builder
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
index 7d60de7..d49e314 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQueryBuilder.java
@@ -64,18 +64,17 @@
public MetaQueryBuilder fillMeta(Integer pageIndex, Integer pageInteger,
Integer pageLength,
String ctx, Boolean cutoff) {
- MetaQueryBuilder meta = new MetaQueryBuilder();
if (pageIndex != null)
- meta.addEntry("startIndex", pageIndex);
+ this.addEntry("startIndex", pageIndex);
if (pageIndex == null && pageInteger != null)
- meta.addEntry("startPage", pageInteger);
+ this.addEntry("startPage", pageInteger);
if (pageLength != null)
- meta.addEntry("count", pageLength);
+ this.addEntry("count", pageLength);
if (ctx != null)
- meta.addContext(ctx);
+ this.addContext(ctx);
if (cutoff != null)
- meta.addEntry("cutOff", cutoff);
- return meta;
+ this.addEntry("cutOff", cutoff);
+ return this;
}
@@ -136,5 +135,16 @@
meta.put("context", this.context);
return meta;
}
+
+ @Override
+ public String toString() {
+ return "SpanContext{" +
+ "left_type='" + left_type + '\'' +
+ ", right_type='" + right_type + '\'' +
+ ", left_size=" + left_size +
+ ", right_size=" + right_size +
+ ", context='" + context + '\'' +
+ '}';
+ }
}
}
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpTree.java
index aba18bb..614fcdd 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpTree.java
@@ -20,10 +20,8 @@
import org.antlr.v4.runtime.tree.ParseTree;
import org.slf4j.LoggerFactory;
-//import de.ids_mannheim.korap.query.poliqarp.PoliqarpLexer;
-//import de.ids_mannheim.korap.query.poliqarp.PoliqarpParser;
-import de.ids_mannheim.korap.query.PoliqarpLexer;
-import de.ids_mannheim.korap.query.PoliqarpParser;
+import de.ids_mannheim.korap.query.poliqarp.PoliqarpPlusLexer;
+import de.ids_mannheim.korap.query.poliqarp.PoliqarpPlusParser;
import de.ids_mannheim.korap.query.serialize.AbstractSyntaxTree;
/**
@@ -403,7 +401,7 @@
// }
private static ParserRuleContext parsePoliqarpQuery (String p) {
- Lexer poliqarpLexer = new PoliqarpLexer((CharStream)null);
+ Lexer poliqarpLexer = new PoliqarpPlusLexer((CharStream)null);
ParserRuleContext tree = null;
// Like p. 111
try {
@@ -412,14 +410,14 @@
ANTLRInputStream input = new ANTLRInputStream(p);
poliqarpLexer.setInputStream(input);
CommonTokenStream tokens = new CommonTokenStream(poliqarpLexer);
- poliqarpParser = new PoliqarpParser(tokens);
+ poliqarpParser = new PoliqarpPlusParser(tokens);
// Don't throw out erroneous stuff
poliqarpParser.setErrorHandler(new BailErrorStrategy());
poliqarpParser.removeErrorListeners();
// Get starting rule from parser
- Method startRule = PoliqarpParser.class.getMethod("request");
+ Method startRule = PoliqarpPlusParser.class.getMethod("request");
tree = (ParserRuleContext) startRule.invoke(poliqarpParser, (Object[])null);
}