ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1556320 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/duration/DurationExpectationFeatureExtractor.java
Date Tue, 07 Jan 2014 19:05:41 GMT
Author: dligach
Date: Tue Jan  7 19:05:41 2014
New Revision: 1556320

URL: http://svn.apache.org/r1556320
Log:
refactoring

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=1556320&r1=1556319&r2=1556320&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
Tue Jan  7 19:05:41 2014
@@ -41,8 +41,8 @@ public class DurationExpectationFeatureE
   public List<Feature> extract(JCas view, Annotation annotation) throws CleartkExtractorException
{ 
 
     List<Feature> features = new ArrayList<Feature>();
-    File durationLookup = new File("/Users/dima/Boston/Thyme/Duration/Output/Duration/distribution.txt");
-    String annotationText = annotation.getCoveredText().toLowerCase();
+    File durationLookup = new File("/Users/Dima/Boston/Thyme/Duration/Output/Duration/distribution.txt");
+    String eventText = annotation.getCoveredText().toLowerCase();
     
     Map<String, Map<String, Float>> textToDistribution = null;
     try {
@@ -52,12 +52,12 @@ public class DurationExpectationFeatureE
       return features;
     }
     
-    Map<String, Float> argDistribution = textToDistribution.get(annotationText);
-    if(argDistribution == null) {
-      features.add(new Feature("arg1_no_duration_info"));
+    Map<String, Float> eventDistribution = textToDistribution.get(eventText);
+    if(eventDistribution == null) {
+      features.add(new Feature("no_duration_info"));
     } else {
-      float expectation1 = expectedDuration(argDistribution);
-      features.add(new Feature("arg1_expected_duration", expectation1));
+      float expectation = expectedDuration(eventDistribution);
+      features.add(new Feature("expected_duration", expectation));
     }
     
     return features;



Mime
View raw message