ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1750202 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/eventTimeRelationPrinter.java
Date Sat, 25 Jun 2016 13:38:51 GMT
Author: dligach
Date: Sat Jun 25 13:38:49 2016
New Revision: 1750202

URL: http://svn.apache.org/viewvc?rev=1750202&view=rev
Log:
added contains-1 printing

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

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/eventTimeRelationPrinter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/eventTimeRelationPrinter.java?rev=1750202&r1=1750201&r2=1750202&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/eventTimeRelationPrinter.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/eventTimeRelationPrinter.java
Sat Jun 25 13:38:49 2016
@@ -160,16 +160,23 @@ public class eventTimeRelationPrinter {
         for(EventMention event : JCasUtil.selectCovered(goldView, EventMention.class, sentence))
{
           for(TimeMention time : JCasUtil.selectCovered(goldView, TimeMention.class, sentence))
{
             BinaryTextRelation timeEventRelation = relationLookup.get(Arrays.asList(time,
event));
-
+            BinaryTextRelation eventTimeRelation = relationLookup.get(Arrays.asList(event,
time));
+            
             String label;
             if(timeEventRelation != null) {
               if(timeEventRelation.getCategory().equals("CONTAINS")) {
-                label = "contains"; 
+                label = "contains";  // this is contains
               } else {
-                label = "none"; // e.g. before or overlap
+                label = "none";      // e.g. before or overlap
+              }
+            } else if(eventTimeRelation != null) {
+              if(eventTimeRelation.getCategory().equals("CONTAINS")) {
+                label = "contains-1"; // this is contains
+              } else {
+                label = "none";       // some other relation type
               }
             } else {
-              label = "none";   // no relation between this time and event
+              label = "none";         // no relation between this time and event
             }
             
             String context;
@@ -185,26 +192,6 @@ public class eventTimeRelationPrinter {
             eventEventRelationsInSentence.add(text.toLowerCase());
           }
         }  
-        
-        //            BinaryTextRelation eventTimeRelation = relationLookup.get(Arrays.asList(event,
time));
-
-        //
-        //            String label;            
-        //            if(forwardRelation != null) {
-        //              if(forwardRelation.getCategory().equals("CONTAINS")) {
-        //                label = "contains";   // this is contains relation
-        //              } else {
-        //                label = "none";       // this is some other relation
-        //              }
-        //            } else if(reverseRelation != null) {
-        //              if(reverseRelation.getCategory().equals("CONTAINS")) {
-        //                label = "contains-1"; // this is contains relation
-        //              } else {
-        //                label = "none";       // this is some other relation
-        //              }
-        //            } else {
-        //              label = "none";         // no relation between mentions
-        //            }
 
         try {
           Files.write(Paths.get(outputFile), eventEventRelationsInSentence, StandardOpenOption.APPEND);



Mime
View raw message