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 5C565100C9 for ; Tue, 4 Jun 2013 18:54:17 +0000 (UTC) Received: (qmail 55360 invoked by uid 500); 4 Jun 2013 18:54:17 -0000 Delivered-To: apmail-ctakes-commits-archive@ctakes.apache.org Received: (qmail 55335 invoked by uid 500); 4 Jun 2013 18:54:17 -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 55328 invoked by uid 99); 4 Jun 2013 18:54:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2013 18:54:16 +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; Tue, 04 Jun 2013 18:54:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 13E852388847; Tue, 4 Jun 2013 18:53:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1489560 - /ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/SelectiveRelationAnnotationViewer.java Date: Tue, 04 Jun 2013 18:53:53 -0000 To: commits@ctakes.apache.org From: dligach@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130604185354.13E852388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dligach Date: Tue Jun 4 18:53:35 2013 New Revision: 1489560 URL: http://svn.apache.org/r1489560 Log: using constants instead of hard-coded values Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/SelectiveRelationAnnotationViewer.java Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/SelectiveRelationAnnotationViewer.java URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/SelectiveRelationAnnotationViewer.java?rev=1489560&r1=1489559&r2=1489560&view=diff ============================================================================== --- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/SelectiveRelationAnnotationViewer.java (original) +++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/SelectiveRelationAnnotationViewer.java Tue Jun 4 18:53:35 2013 @@ -27,6 +27,7 @@ import java.util.Scanner; import java.util.Set; import org.apache.ctakes.relationextractor.eval.XMIReader; +import org.apache.ctakes.typesystem.type.constants.CONST; import org.apache.ctakes.typesystem.type.refsem.OntologyConcept; import org.apache.ctakes.typesystem.type.refsem.UmlsConcept; import org.apache.ctakes.typesystem.type.relation.BinaryTextRelation; @@ -125,15 +126,15 @@ public class SelectiveRelationAnnotation int type2 = entity2.getTypeID(); // first argument has to be an anatomical site - if(type1 != 6) { + if(type1 != CONST.NE_TYPE_ID_ANATOMICAL_SITE) { continue; } // skip location_of(anatomical site, anatomical site) - if(type1 == 6 && type2 == 6) { + if(type1 == CONST.NE_TYPE_ID_ANATOMICAL_SITE && type2 == CONST.NE_TYPE_ID_ANATOMICAL_SITE) { continue; } // "to" is not a valid disease/disorder - if(type2 == 3 && arg2.equals("to")) { + if(type2 == CONST.NE_TYPE_ID_DISORDER && arg2.equals("to")) { continue; } @@ -185,7 +186,7 @@ public class SelectiveRelationAnnotation UmlsConcept umlsConcept = (UmlsConcept) ontologyConcept; String code = umlsConcept.getCui(); codes.add(code); - } else { // SNOMED or RxNorm + } else { // RxNorm String code = ontologyConcept.getCodingScheme() + ontologyConcept.getCode(); codes.add(code); }