You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by mt...@apache.org on 2014/02/28 11:07:06 UTC

svn commit: r1572900 - /uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaTypeMatcher.java

Author: mtoepfer
Date: Fri Feb 28 10:07:05 2014
New Revision: 1572900

URL: http://svn.apache.org/r1572900
Log:
no jira - check on boundary when moving to next annotation

Modified:
    uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaTypeMatcher.java

Modified: uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaTypeMatcher.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaTypeMatcher.java?rev=1572900&r1=1572899&r2=1572900&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaTypeMatcher.java (original)
+++ uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaTypeMatcher.java Fri Feb 28 10:07:05 2014
@@ -82,6 +82,9 @@ public class RutaTypeMatcher implements 
 
   public Collection<AnnotationFS> getAnnotationsAfter(RutaRuleElement ruleElement,
           AnnotationFS annotation, RutaStream stream, RutaBlock parent) {
+    if(annotation.getEnd() == stream.getDocumentAnnotation().getEnd()) {
+      return Collections.emptyList();
+    }
     RutaBasic lastBasic = stream.getEndAnchor(annotation.getEnd());
     int end = 0;
     if (lastBasic == null) {
@@ -133,6 +136,9 @@ public class RutaTypeMatcher implements 
 
   public Collection<AnnotationFS> getAnnotationsBefore(RutaRuleElement ruleElement,
           AnnotationFS annotation, RutaStream stream, RutaBlock parent) {
+    if(annotation.getBegin() == stream.getDocumentAnnotation().getBegin()) {
+      return Collections.emptyList();
+    }
     RutaBasic firstBasic = stream.getBeginAnchor(annotation.getBegin());
     if (firstBasic == null) {
       return Collections.emptyList();