ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
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 GMT
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);
       }



Mime
View raw message