ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1591717 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/duration/DurationExpectationFeatureExtractor.java
Date Thu, 01 May 2014 17:27:21 GMT
Author: dligach
Date: Thu May  1 17:27:20 2014
New Revision: 1591717

URL: http://svn.apache.org/r1591717
Log:
lemmatizing verb events

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/duration/DurationExpectationFeatureExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/duration/DurationExpectationFeatureExtractor.java?rev=1591717&r1=1591716&r2=1591717&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/duration/DurationExpectationFeatureExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/duration/DurationExpectationFeatureExtractor.java
Thu May  1 17:27:20 2014
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.ctakes.temporal.duration.Utils;
+import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.tcas.Annotation;
 import org.cleartk.classifier.Feature;
@@ -39,9 +40,16 @@ public class DurationExpectationFeatureE
   @Override
   public List<Feature> extract(JCas view, Annotation annotation) throws CleartkExtractorException
{ 
 
-    List<Feature> features = new ArrayList<Feature>();
+    List<Feature> features = new ArrayList<>();
     File durationLookup = new File(Utils.durationDistributionPath);
-    String eventText = annotation.getCoveredText().toLowerCase();
+    
+    String eventText;
+    try {
+      eventText = Utils.normalizeEventText(view, annotation);
+    } catch (AnalysisEngineProcessException e1) {
+      e1.printStackTrace();
+      return features;
+    } 
     
     Map<String, Map<String, Float>> textToDistribution = null;
     try {
@@ -58,7 +66,7 @@ public class DurationExpectationFeatureE
       float expectation = Utils.expectedDuration(eventDistribution);
       features.add(new Feature("expected_duration", expectation));
     }
-    
+
     return features;
   }
 }
\ No newline at end of file



Mime
View raw message