You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2015/02/13 21:09:48 UTC
svn commit: r1659659 -
/uima/ruta/trunk/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaTypeMatcher.java
Author: pkluegl
Date: Fri Feb 13 20:09:48 2015
New Revision: 1659659
URL: http://svn.apache.org/r1659659
Log:
UIMA-4237
- check on actual type of document 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=1659659&r1=1659658&r2=1659659&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 13 20:09:48 2015
@@ -60,10 +60,12 @@ public class RutaTypeMatcher implements
if (type == null) {
continue;
}
+ Type currentDAType = stream.getCas().getDocumentAnnotation().getType();
String name = type.getName();
RutaBasic firstBasicOfAll = stream.getFirstBasicOfAll();
if ("uima.tcas.DocumentAnnotation".equals(name)
|| "org.apache.uima.ruta.type.Document".equals(name)
+ || currentDAType.equals(type)
|| (stream.getDocumentAnnotationType().getName().equals(name) && (firstBasicOfAll != null && firstBasicOfAll
.beginsWith(type)))) {
// TODO what about dynamic windowing?
@@ -147,6 +149,7 @@ public class RutaTypeMatcher implements
if (stream.isVisible(firstBasic)) {
stream.moveToPrevious();
}
+
if (stream.isValid()) {
RutaBasic nextBasic = (RutaBasic) stream.get();
// TODO HOTFIX for annotation of length 0