ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1589217 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/data/analysis/GoldRelationViewer.java
Date Tue, 22 Apr 2014 17:33:09 GMT
Author: dligach
Date: Tue Apr 22 17:33:09 2014
New Revision: 1589217

URL: http://svn.apache.org/r1589217
Log:
added event-time relations where arg1=event and arg2=time

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/data/analysis/GoldRelationViewer.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/data/analysis/GoldRelationViewer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/data/analysis/GoldRelationViewer.java?rev=1589217&r1=1589216&r2=1589217&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/data/analysis/GoldRelationViewer.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/data/analysis/GoldRelationViewer.java
Tue Apr 22 17:33:09 2014
@@ -132,9 +132,16 @@ public class GoldRelationViewer {
         // retrieve event-time relations in this sentece
         for(EventMention eventMention : eventMentionsInSentence) {
           for(TimeMention timeMention : timeMentionsInSentence) {
-            BinaryTextRelation relation = relationLookup.get(Arrays.asList(timeMention, eventMention));
-            if(relation != null) {
-              String text = String.format("%s(%s, %s)", relation.getCategory(), timeMention.getCoveredText(),
eventMention.getCoveredText());
+            // there are relations where arg1=time and arg2=event
+            BinaryTextRelation timeEventRel = relationLookup.get(Arrays.asList(timeMention,
eventMention));
+            if(timeEventRel != null) {
+              String text = String.format("%s(%s, %s)", timeEventRel.getCategory(), timeMention.getCoveredText(),
eventMention.getCoveredText());
+              formattedRelationsInSentence.add(text);
+            } 
+            // and relations where arg1=event and arg2=time
+            BinaryTextRelation eventTimeRel = relationLookup.get(Arrays.asList(eventMention,
timeMention));
+            if(eventTimeRel != null) {
+              String text = String.format("%s(%s, %s)", eventTimeRel.getCategory(), eventMention.getCoveredText(),
timeMention.getCoveredText());
               formattedRelationsInSentence.add(text);
             }
           }



Mime
View raw message