Added comments
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java
index 16b771c..c752776 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java
@@ -13,6 +13,13 @@
import de.ids_mannheim.korap.query.spans.AttributeSpans;
+/** Span enumerations of attributes (i.e. spans with prefix @, for example
+ * @:class=header) commonly used to search elements with some specific
+ * attribute(s). Negation allows for searching element <em>without</em> some
+ * attribute(s).
+ *
+ * @author margaretha
+ * */
public class SpanAttributeQuery extends SimpleSpanQuery{
boolean isNegation;
@@ -21,7 +28,8 @@
super(firstClause, collectPayloads);
}
- public SpanAttributeQuery(SpanTermQuery firstClause, boolean isNegation, boolean collectPayloads) {
+ public SpanAttributeQuery(SpanTermQuery firstClause, boolean isNegation,
+ boolean collectPayloads) {
super(firstClause, collectPayloads);
this.isNegation = isNegation;
}
@@ -30,6 +38,7 @@
public SimpleSpanQuery clone() {
SpanAttributeQuery sq = new SpanAttributeQuery(
(SpanTermQuery) this.firstClause.clone(),
+ this.isNegation,
this.collectPayloads);
sq.setBoost(getBoost());
return sq;
@@ -46,7 +55,8 @@
StringBuilder sb = new StringBuilder();
sb.append("spanAttribute(");
sb.append(firstClause.toString(field));
- sb.append(")");
+ sb.append(",");
+ sb.append(isNegation ? "negated)" : "notNegated)");
sb.append(ToStringUtils.boost(getBoost()));
return sb.toString();
}
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanElementAttributeQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanElementAttributeQuery.java
index 83099ec..a67fd9f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanElementAttributeQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanElementAttributeQuery.java
@@ -14,6 +14,11 @@
import de.ids_mannheim.korap.query.spans.ElementAttributeSpans;
+/** Span enumerations of elements having some specific attribute(s) or <em>not</em>
+ * having some attribute(s).
+ *
+ * @author margaretha
+ * */
public class SpanElementAttributeQuery extends SimpleSpanQuery{
boolean isMultipleAttributes;