ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1467394 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java
Date Fri, 12 Apr 2013 18:21:52 GMT
Author: clin
Date: Fri Apr 12 18:21:52 2013
New Revision: 1467394

URL: http://svn.apache.org/r1467394
Log:
Add nearby Number Token as a feature for docTimeRel 

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java?rev=1467394&r1=1467393&r2=1467394&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java
Fri Apr 12 18:21:52 2013
@@ -23,6 +23,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ctakes.typesystem.type.syntax.NumToken;
 import org.apache.ctakes.typesystem.type.textsem.DateAnnotation;
 import org.apache.ctakes.typesystem.type.textsem.EventMention;
 import org.apache.ctakes.typesystem.type.textsem.MeasurementAnnotation;
@@ -76,6 +77,17 @@ public class DateAndMeasurementExtractor
 		  }
 	  }
 	  
+	//4 get number
+	  if (sentList != null && !sentList.isEmpty()){
+		  for(Sentence sent : sentList) {
+			  for (@SuppressWarnings("unused") NumToken date : JCasUtil.selectCovered(view, NumToken.class,
sent)) {
+				  Feature indicator = new Feature("NumTokenNearby", "NumToken");
+				  features.add(indicator);
+				  break;
+			  }
+		  }
+	  }
+	  
 	  return features;
   }
 



Mime
View raw message