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 5698517C0D for ; Sat, 3 Oct 2015 18:03:00 +0000 (UTC) Received: (qmail 51187 invoked by uid 500); 3 Oct 2015 18:03:00 -0000 Delivered-To: apmail-ctakes-commits-archive@ctakes.apache.org Received: (qmail 51147 invoked by uid 500); 3 Oct 2015 18:03:00 -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 51138 invoked by uid 99); 3 Oct 2015 18:03:00 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2015 18:03:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A4FA0C1D9F for ; Sat, 3 Oct 2015 18:02:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.99 X-Spam-Level: X-Spam-Status: No, score=0.99 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 4xfi-2kEuSHg for ; Sat, 3 Oct 2015 18:02:49 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id A06FE439D6 for ; Sat, 3 Oct 2015 18:02:48 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 165B7E0252 for ; Sat, 3 Oct 2015 18:02:48 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 0F6883A0444 for ; Sat, 3 Oct 2015 18:02:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1706614 - /ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/DeepPheAnaforaXMLReader.java Date: Sat, 03 Oct 2015 18:02:47 -0000 To: commits@ctakes.apache.org From: dligach@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151003180248.0F6883A0444@svn01-us-west.apache.org> Author: dligach Date: Sat Oct 3 18:02:47 2015 New Revision: 1706614 URL: http://svn.apache.org/viewvc?rev=1706614&view=rev Log: how handling the fact that a disease disorder (or metastasis) can be linked to multiple anatomical sites Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/DeepPheAnaforaXMLReader.java Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/DeepPheAnaforaXMLReader.java URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/DeepPheAnaforaXMLReader.java?rev=1706614&r1=1706613&r2=1706614&view=diff ============================================================================== --- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/DeepPheAnaforaXMLReader.java (original) +++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/DeepPheAnaforaXMLReader.java Sat Oct 3 18:02:47 2015 @@ -96,7 +96,7 @@ public class DeepPheAnaforaXMLReader ext for (Element annotationsElem : dataElem.getChildren("annotations")) { Map idToAnnotation = Maps.newHashMap(); - Map diseaseDisorderToBodyLocation = Maps.newHashMap(); + Map> diseaseDisorderToAnatomicalSites = Maps.newHashMap(); for (Element entityElem : annotationsElem.getChildren("entity")) { @@ -127,8 +127,12 @@ public class DeepPheAnaforaXMLReader ext DiseaseDisorderMention diseaseDisorderMention = new DiseaseDisorderMention(jCas, begin, end); diseaseDisorderMention.addToIndexes(); idToAnnotation.put(id, diseaseDisorderMention); - String bodyLocationId = removeSingleChildText(propertiesElem, "body_location", id); - diseaseDisorderToBodyLocation.put(id, bodyLocationId); + List anatomicalSiteIds = Lists.newArrayList(); + for(Element child : propertiesElem.getChildren("body_location")) { + String bodyLocationId = child.getText(); + anatomicalSiteIds.add(bodyLocationId); + } + diseaseDisorderToAnatomicalSites.put(id, anatomicalSiteIds); } else if(type.equals("Anatomical_site")) { AnatomicalSiteMention anatomicalSiteMention = new AnatomicalSiteMention(jCas, begin, end); anatomicalSiteMention.addToIndexes(); @@ -138,11 +142,12 @@ public class DeepPheAnaforaXMLReader ext } } - for(String diseaseDisorderId : diseaseDisorderToBodyLocation.keySet()) { + for(String diseaseDisorderId : diseaseDisorderToAnatomicalSites.keySet()) { IdentifiedAnnotation diseaseDisorderMention = idToAnnotation.get(diseaseDisorderId); - String anatomicalSiteId = diseaseDisorderToBodyLocation.get(diseaseDisorderId); - IdentifiedAnnotation anatomicalSiteMention = idToAnnotation.get(anatomicalSiteId); - createLocationOfRelation(jCas, diseaseDisorderMention, anatomicalSiteMention); + for(String anatomicalSiteId : diseaseDisorderToAnatomicalSites.get(diseaseDisorderId)) { + IdentifiedAnnotation anatomicalSiteMention = idToAnnotation.get(anatomicalSiteId); + createLocationOfRelation(jCas, diseaseDisorderMention, anatomicalSiteMention); + } } } }