Fixed tests regarding WithinSpans
Change-Id: I9f202f014640774040bda7602e22adb135ad5d0d
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
index 6764c9d..dad2fe5 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
@@ -14,6 +14,9 @@
import de.ids_mannheim.korap.query.SpanRepetitionQuery;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Enumeration of spans occurring multiple times in a sequence. The
* number of
@@ -23,11 +26,16 @@
* */
public class RepetitionSpans extends SimpleSpans {
+ // Logger
+ private final Logger log = LoggerFactory.getLogger(RepetitionSpans.class);
+
+ // This advices the java compiler to ignore all loggings
+ public static final boolean DEBUG = false;
+
private int min, max;
private long matchCost;
private List<CandidateSpan> matchList;
-
/**
* Constructs RepetitionSpans from the given
* {@link SpanRepetitionQuery}.
@@ -106,6 +114,15 @@
while ((hasMoreSpans = firstSpans.next())
&& startSpan.getDoc() == firstSpans.doc()) {
+ if (DEBUG) {
+ log.debug("Check adjacency at {}-{}|{}-{} in {}",
+ prevSpan.getStart(),
+ prevSpan.getEnd(),
+ firstSpans.start(),
+ firstSpans.end(),
+ startSpan.getDoc());
+ };
+
if (firstSpans.start() > prevSpan.getEnd()) {
break;
}
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index 5fed33b..78bf62e 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -9,6 +9,7 @@
# log4j.logger.de.ids_mannheim.korap.query.spans.ElementAttributeSpans = TRACE, stdout
# log4j.logger.de.ids_mannheim.korap.query.spans.KorapTermSpan = TRACE, stdout
# log4j.logger.de.ids_mannheim.korap.query.spans.WithinSpans = TRACE, stdout
+# log4j.logger.de.ids_mannheim.korap.query.spans.RepetitionSpans = TRACE, stdout
# log4j.logger.de.ids_mannheim.korap.query.spans.NextSpans = TRACE, stdout
# log4j.logger.de.ids_mannheim.korap.query.spans.SimpleSpans = TRACE, stdout
# log4j.logger.de.ids_mannheim.korap.query.spans.ClassSpans = TRACE, stdout