ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1631581 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
Date Mon, 13 Oct 2014 22:19:52 GMT
Author: tmill
Date: Mon Oct 13 22:19:52 2014
New Revision: 1631581

URL: http://svn.apache.org/r1631581
Log:
CTAKES-82: Give properties to new events.

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java?rev=1631581&r1=1631580&r2=1631581&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/EventAnnotator.java
Mon Oct 13 22:19:52 2014
@@ -32,6 +32,8 @@ import org.apache.ctakes.temporal.ae.fea
 import org.apache.ctakes.temporal.ae.feature.selection.FeatureSelection;
 import org.apache.ctakes.temporal.utils.SMOTEplus;
 import org.apache.ctakes.typesystem.type.constants.CONST;
+import org.apache.ctakes.typesystem.type.refsem.Event;
+import org.apache.ctakes.typesystem.type.refsem.EventProperties;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 import org.apache.ctakes.typesystem.type.syntax.Chunk;
 import org.apache.ctakes.typesystem.type.textsem.EventMention;
@@ -358,7 +360,17 @@ public class EventAnnotator extends Temp
 
       // during prediction, convert chunk labels to events and add them to the CAS
       if (!this.isTraining()) {
-        this.eventChunking.createChunks(jCas, tokens, outcomes);
+        List<EventMention> createdEvents = this.eventChunking.createChunks(jCas, tokens,
outcomes);
+        for(EventMention mention : createdEvents){
+          if(mention.getEvent() == null){
+            Event event = new Event(jCas);
+            EventProperties props = new EventProperties(jCas);
+            props.addToIndexes();
+            event.setProperties(props);
+            mention.setEvent(event);
+            event.addToIndexes();
+          }
+        }
       }
     }
     if(this.isTraining() && this.smoteNumOfNeighbors >= 1){ //add synthetic instances
to datawriter, if smote is selected



Mime
View raw message