Merge pull request #72 from apache/bugfix/UIMA-6409-Ruta-possible-endless-wildcard-lookahead-in-combination-with-subtokens
UIMA-6409: Ruta: possible endless wildcard lookahead in combination with subtokens
diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java b/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java
index 94d07d5..1b688a3 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java
@@ -507,8 +507,8 @@
}
if (annotation != null && iterator != null && iterator.isValid()) {
AnnotationFS pointer = iterator.get();
- if ((after && pointer.getEnd() == annotation.getEnd())
- || (!after && pointer.getBegin() == annotation.getBegin())) {
+ if ((after && pointer.getBegin() < annotation.getEnd())
+ || (!after && pointer.getEnd() > annotation.getBegin())) {
moveOn(after, iterator, stream);
}
}