ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1758482 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/EventTimeRelPrinter.java
Date Tue, 30 Aug 2016 21:49:47 GMT
Author: dligach
Date: Tue Aug 30 21:49:47 2016
New Revision: 1758482

URL: http://svn.apache.org/viewvc?rev=1758482&view=rev
Log:
now picking contains over other relations when duplicate exist

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/EventTimeRelPrinter.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/EventTimeRelPrinter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/EventTimeRelPrinter.java?rev=1758482&r1=1758481&r2=1758482&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/EventTimeRelPrinter.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/EventTimeRelPrinter.java
Tue Aug 30 21:49:47 2016
@@ -50,6 +50,7 @@ import org.apache.uima.fit.pipeline.Simp
 import org.apache.uima.fit.util.JCasUtil;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.tcas.Annotation;
+import org.cleartk.util.ViewUriUtil;
 
 import com.lexicalscope.jewel.cli.CliFactory;
 import com.lexicalscope.jewel.cli.Option;
@@ -157,7 +158,13 @@ public class EventTimeRelPrinter {
         Annotation arg2 = relation.getArg2().getArgument();
 
         if(relationLookup.get(Arrays.asList(arg1, arg2)) != null) {
-          System.out.println("duplicate relation: " + arg1.getCoveredText() + " ... " + arg2.getCoveredText());
+          // there is already a relation between arg1 and arg2
+          // only store if it is 'contains' relation 
+          if(relation.getCategory().equals("CONTAINS")) {
+            relationLookup.put(Arrays.asList(arg1, arg2), relation);
+          } else {
+            System.out.println("skipping relation: " + arg1.getCoveredText() + " ... " +
arg2.getCoveredText());
+          }
         } else {
           relationLookup.put(Arrays.asList(arg1, arg2), relation);
         }
@@ -174,18 +181,6 @@ public class EventTimeRelPrinter {
             BinaryTextRelation timeEventRelation = relationLookup.get(Arrays.asList(time,
event));
             BinaryTextRelation eventTimeRelation = relationLookup.get(Arrays.asList(event,
time));
 
-            if(time.getCoveredText().toLowerCase().equals("an additional couple of weeks")
&& event.getCoveredText().toLowerCase().equals("starting")) {
-              System.out.println(sentence.getCoveredText());
-              System.out.println("time-event:" + (timeEventRelation == null ? "null" : timeEventRelation.getCategory()));
-              System.out.println("event-time:" + (eventTimeRelation == null ? "null" : eventTimeRelation.getCategory()));
-            }
-            
-            if(time.getCoveredText().toLowerCase().equals("nine") && event.getCoveredText().toLowerCase().equals("cycles"))
{
-              System.out.println(sentence.getCoveredText());
-              System.out.println("time-event:" + (timeEventRelation == null ? "null" : timeEventRelation.getCategory()));
-              System.out.println("event-time:" + (eventTimeRelation == null ? "null" : eventTimeRelation.getCategory()));
-            }
-
             String label = "none";
             if(timeEventRelation != null) {
               if(timeEventRelation.getCategory().equals("CONTAINS")) {



Mime
View raw message