Return-Path: X-Original-To: apmail-ctakes-commits-archive@www.apache.org Delivered-To: apmail-ctakes-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E9A9E1175A for ; Mon, 12 May 2014 15:11:53 +0000 (UTC) Received: (qmail 45374 invoked by uid 500); 12 May 2014 15:05:12 -0000 Delivered-To: apmail-ctakes-commits-archive@ctakes.apache.org Received: (qmail 45342 invoked by uid 500); 12 May 2014 15:05:12 -0000 Mailing-List: contact commits-help@ctakes.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ctakes.apache.org Delivered-To: mailing list commits@ctakes.apache.org Received: (qmail 45335 invoked by uid 99); 12 May 2014 15:05:12 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2014 15:05:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2014 15:05:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8CB712388860; Mon, 12 May 2014 15:04:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@ctakes.apache.org From: tmill@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140512150449.8CB712388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 beforeSet = Sets.newHashSet("BEFORE", "ENDED_BY", "BEFORE_OVERLAP"); + private static final Set 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();