search context parameter for sent/para
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 277e17d..12aded1 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
@@ -17,15 +17,17 @@
this.meta = new LinkedHashMap();
}
+ /**
+ * context segment if context is either of type char or token.
+ * size can differ for left and right span
+ * @param left
+ * @param leftType
+ * @param right
+ * @param rightType
+ * @return
+ */
public MetaQueryBuilder addContext(Integer left, String leftType,
Integer right, String rightType) {
- if (leftType.equalsIgnoreCase("sentence") | leftType.equalsIgnoreCase("paragraph")) {
- addEntry("context", leftType);
- return this;
- } else if (rightType.equalsIgnoreCase("sentence") | rightType.equalsIgnoreCase("paragraph")) {
- addEntry("context", rightType);
- return this;
- }
Map map = new LinkedHashMap();
List l = new LinkedList();
List r = new LinkedList();
@@ -39,6 +41,17 @@
return this;
}
+ /**
+ * context if of type paragraph or sentence where left and right size delimiters are irrelevant.
+ * @param type
+ * @return
+ */
+ public MetaQueryBuilder addContext(String type) {
+ addEntry("context", type);
+ return this;
+ }
+
+
public MetaQueryBuilder addEntry(String name, Object value) {
meta.put(name, value);
return this;