ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1527090 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventDurationFeatureExtractor.java
Date Fri, 27 Sep 2013 21:33:55 GMT
Author: dligach
Date: Fri Sep 27 21:33:55 2013
New Revision: 1527090

URL: http://svn.apache.org/r1527090
Log:
no_duration feature if no data is available

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventDurationFeatureExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventDurationFeatureExtractor.java?rev=1527090&r1=1527089&r2=1527090&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventDurationFeatureExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventDurationFeatureExtractor.java
Fri Sep 27 21:33:55 2013
@@ -50,14 +50,19 @@ public class EventDurationFeatureExtract
       Map<String, Map<String, Float>> textToDistribution = Files.readLines(durationLookup,
Charsets.UTF_8, new Callback());
       
       Map<String, Float> distribution1 = textToDistribution.get(arg1.getCoveredText());
-      if(distribution1 != null) {
+      if(distribution1 == null) {
+        features.add(new Feature("arg1_no_duration_info"));
+      } else {
         for(String duration : distribution1.keySet()) {
           features.add(new Feature("arg1_" + duration, distribution1.get(duration)));
         }
+        // System.out.println(arg1.getCoveredText() + ": " + features);
       }
       
       Map<String, Float> distribution2 = textToDistribution.get(arg2.getCoveredText());
-      if(distribution2 != null) {
+      if(distribution2 == null) {
+        features.add(new Feature("arg2_no_duration_info"));
+      } else {
         for(String duration : distribution2.keySet()) {
           features.add(new Feature("arg2_" + duration, distribution2.get(duration)));
         }



Mime
View raw message