ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1596008 - /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/GenerateDependencyRepresentation.java
Date Mon, 19 May 2014 19:47:28 GMT
Author: tmill
Date: Mon May 19 19:47:28 2014
New Revision: 1596008

URL: http://svn.apache.org/r1596008
Log:
Checked in minor missing change clamored for by another file.

Modified:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/GenerateDependencyRepresentation.java

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/GenerateDependencyRepresentation.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/GenerateDependencyRepresentation.java?rev=1596008&r1=1596007&r2=1596008&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/GenerateDependencyRepresentation.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/pipelines/GenerateDependencyRepresentation.java
Mon May 19 19:47:28 2014
@@ -56,7 +56,7 @@ public class GenerateDependencyRepresent
   private static SemanticClasses sems = null; 
   private static PrintStream out = null;
   private static Logger log = Logger.getLogger(GenerateDependencyRepresentation.class);
-
+  public static final int UP_NODES = 2;
   /**
    * @param args
    * @throws CmdLineException 
@@ -94,6 +94,7 @@ public class GenerateDependencyRepresent
   public static void processDocument(JCas jcas) {
     log.info("Processing document: " + DocumentIDAnnotationUtil.getDocumentID(jcas));
     Collection<Sentence> sents = JCasUtil.select(jcas, Sentence.class);
+    Sentence lastSent=null;
     for(Sentence sent : sents){
       List<ConllDependencyNode> nodes = JCasUtil.selectCovered(jcas, ConllDependencyNode.class,
sent);
 
@@ -103,7 +104,10 @@ public class GenerateDependencyRepresent
       
       for(IdentifiedAnnotation mention : mentions){
 
-        SimpleTree tree = AssertionDepUtils.getTokenTreeString(jcas, nodes, mention);
+        if(lastSent != null && lastSent.getCoveredText().startsWith("Indications")){
+          continue;
+        }
+        SimpleTree tree = AssertionDepUtils.getTokenTreeString(jcas, nodes, mention, UP_NODES);
         
 //        String treeStr = AnnotationDepUtils.getTokenRelTreeString(jcas, nodes, new Annotation[]{mention},
new String[]{"CONCEPT"}, true);
         
@@ -126,7 +130,7 @@ public class GenerateDependencyRepresent
 //        node2tree.get(headNode).cat = realCat;
 
       }
-      
+      lastSent = sent;
 //      out.println(node2tree.get(rootNode).toString());
     }
   }



Mime
View raw message