ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1593990 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/I2B2TemporalXMLReader.java
Date Mon, 12 May 2014 15:04:49 GMT
Author: tmill
Date: Mon May 12 15:04:49 2014
New Revision: 1593990

URL: http://svn.apache.org/r1593990
Log:
CTAKES-95: Updates to i2b2 xml reader to merge i2b2 relations.

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/I2B2TemporalXMLReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/I2B2TemporalXMLReader.java?rev=1593990&r1=1593989&r2=1593990&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/I2B2TemporalXMLReader.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/I2B2TemporalXMLReader.java
Mon May 12 15:04:49 2014
@@ -5,6 +5,7 @@ import java.io.IOException;
 import java.net.MalformedURLException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.refsem.Event;
@@ -27,6 +28,8 @@ import org.uimafit.component.JCasAnnotat
 import org.uimafit.descriptor.ConfigurationParameter;
 import org.uimafit.factory.AnalysisEngineFactory;
 
+import com.google.common.collect.Sets;
+
 public class I2B2TemporalXMLReader extends JCasAnnotator_ImplBase {
   public static final String PARAM_INPUT_DIR = "PARAM_INPUT_DIR";
   @ConfigurationParameter(
@@ -42,6 +45,9 @@ public class I2B2TemporalXMLReader exten
       description="Whether to map i2b2 relations/properties/types to THYME types")
   protected boolean mapThyme=false;
   
+  private static final Set<String> beforeSet = Sets.newHashSet("BEFORE", "ENDED_BY",
"BEFORE_OVERLAP");
+  private static final Set<String> afterSet = Sets.newHashSet("BEGUN_BY", "AFTER");
+  
   @Override
   public void process(JCas jcas) throws AnalysisEngineProcessException {
     File textFile = new File(ViewURIUtil.getURI(jcas));
@@ -118,7 +124,14 @@ public class I2B2TemporalXMLReader exten
       if(mapThyme){
         throw new UnsupportedOperationException("Mapping to THYME relations is not implemented
yet!");
       }else{
-        link.setCategory(cat);
+        if(beforeSet.contains(cat)){
+          link.setCategory("BEFORE");
+        }else if(afterSet.contains(cat)){
+          link.setCategory("AFTER");
+        }else{
+          link.setCategory("OVERLAP");
+        }
+//        link.setCategory(cat);
       }
       link.addToIndexes();
       arg1.addToIndexes();



Mime
View raw message