ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1491961 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/TimeXExtractor.java
Date Tue, 11 Jun 2013 21:09:01 GMT
Author: clin
Date: Tue Jun 11 21:09:01 2013
New Revision: 1491961

URL: http://svn.apache.org/r1491961
Log:
ctakes-temporal: add time word type gazetteer features for an event's nearby time expressions.


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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/TimeXExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/TimeXExtractor.java?rev=1491961&r1=1491960&r2=1491961&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/TimeXExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/TimeXExtractor.java
Tue Jun 11 21:09:01 2013
@@ -32,6 +32,7 @@ import org.apache.ctakes.typesystem.type
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.tcas.Annotation;
+import org.apache.uima.resource.ResourceInitializationException;
 import org.cleartk.classifier.Feature;
 import org.cleartk.classifier.feature.extractor.CleartkExtractorException;
 import org.cleartk.classifier.feature.extractor.simple.SimpleFeatureExtractor;
@@ -42,14 +43,16 @@ public class TimeXExtractor implements S
   private String name;
   private EventTimeFlatTreeFeatureExtractor path;
   private TemporalAttributeFeatureExtractor attr;
+  private TimeWordTypeExtractor timewd;
 
 //  private Logger logger = Logger.getLogger(this.getClass().getName());
 
-  public TimeXExtractor() {
+  public TimeXExtractor() throws ResourceInitializationException {
     super();
     this.name = "TimeXFeature";
     this.path = new EventTimeFlatTreeFeatureExtractor();
     this.attr = new TemporalAttributeFeatureExtractor();
+    this.timewd = new TimeWordTypeExtractor();
   }
 
   @Override
@@ -84,6 +87,7 @@ public class TimeXExtractor implements S
 			  try {
 				  features.addAll(this.path.extract(view, targetTokenAnnotation, entry.getValue()));//add
path between timex and event
 				  features.addAll(this.attr.extract(view, targetTokenAnnotation, entry.getValue()));//add
temporal attribute features
+				  features.addAll(this.timewd.extract(view, entry.getValue()));
 			  } catch (AnalysisEngineProcessException e) {
 				  throw new IllegalArgumentException(String.format("error in gererating path feature:",
features));
 			  }



Mime
View raw message