ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1467386 - in /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae: DocTimeRelAnnotator.java feature/DateAndMeasurementExtractor.java feature/DateXExtractor.java
Date Fri, 12 Apr 2013 18:04:40 GMT
Author: clin
Date: Fri Apr 12 18:04:39 2013
New Revision: 1467386

URL: http://svn.apache.org/r1467386
Log:
add MeasurmentAnnotation feature extractor for docTimerel

Added:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java
      - copied, changed from r1467344, ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateXExtractor.java
Removed:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateXExtractor.java
Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java?rev=1467386&r1=1467385&r2=1467386&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/DocTimeRelAnnotator.java
Fri Apr 12 18:04:39 2013
@@ -22,7 +22,7 @@ import java.io.File;
 import java.util.List;
 
 import org.apache.ctakes.temporal.ae.feature.ClosestVerbExtractor;
-import org.apache.ctakes.temporal.ae.feature.DateXExtractor;
+import org.apache.ctakes.temporal.ae.feature.DateAndMeasurementExtractor;
 import org.apache.ctakes.temporal.ae.feature.EvevtPropertyExtractor;
 import org.apache.ctakes.temporal.ae.feature.NearbyVerbTenseXExtractor;
 import org.apache.ctakes.temporal.ae.feature.SectionHeaderExtractor;
@@ -82,7 +82,7 @@ public class DocTimeRelAnnotator extends
   private ClosestVerbExtractor closestVerbExtractor;
   private TimeXExtractor timeXExtractor;
   private EvevtPropertyExtractor genericExtractor;
-  private DateXExtractor dateExtractor;
+  private DateAndMeasurementExtractor dateExtractor;
 
   @Override
   public void initialize(UimaContext context) throws ResourceInitializationException {
@@ -101,7 +101,7 @@ public class DocTimeRelAnnotator extends
     this.closestVerbExtractor = new ClosestVerbExtractor();
     this.timeXExtractor = new TimeXExtractor();
     this.genericExtractor = new EvevtPropertyExtractor();
-    this.dateExtractor = new DateXExtractor();
+    this.dateExtractor = new DateAndMeasurementExtractor();
   }
 
   @Override

Copied: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java
(from r1467344, ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateXExtractor.java)
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java?p2=ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java&p1=ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateXExtractor.java&r1=1467344&r2=1467386&rev=1467386&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateXExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/DateAndMeasurementExtractor.java
Fri Apr 12 18:04:39 2013
@@ -25,6 +25,7 @@ import java.util.Map;
 
 import org.apache.ctakes.typesystem.type.textsem.DateAnnotation;
 import org.apache.ctakes.typesystem.type.textsem.EventMention;
+import org.apache.ctakes.typesystem.type.textsem.MeasurementAnnotation;
 import org.apache.ctakes.typesystem.type.textspan.Sentence;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.tcas.Annotation;
@@ -33,11 +34,11 @@ import org.cleartk.classifier.feature.ex
 import org.cleartk.classifier.feature.extractor.simple.SimpleFeatureExtractor;
 import org.uimafit.util.JCasUtil;
 
-public class DateXExtractor implements SimpleFeatureExtractor {
+public class DateAndMeasurementExtractor implements SimpleFeatureExtractor {
 
   private String name;
 
-  public DateXExtractor() {
+  public DateAndMeasurementExtractor() {
     super();
     this.name = "DateXFeature";
     
@@ -64,7 +65,17 @@ public class DateXExtractor implements S
 		  }
 	  }
 	  
-
+	//3 get Measurement
+	  if (sentList != null && !sentList.isEmpty()){
+		  for(Sentence sent : sentList) {
+			  for (@SuppressWarnings("unused") MeasurementAnnotation date : JCasUtil.selectCovered(view,
MeasurementAnnotation.class, sent)) {
+				  Feature indicator = new Feature("MeasurementNearby", "measure");
+				  features.add(indicator);
+				  break;
+			  }
+		  }
+	  }
+	  
 	  return features;
   }
 



Mime
View raw message