ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1746597 - /ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
Date Thu, 02 Jun 2016 15:53:17 GMT
Author: dligach
Date: Thu Jun  2 15:53:17 2016
New Revision: 1746597

URL: http://svn.apache.org/viewvc?rev=1746597&view=rev
Log:
now using Files.write(...) to write entire set of relations

Modified:
    ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java

Modified: ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java?rev=1746597&r1=1746596&r2=1746597&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
(original)
+++ ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
Thu Jun  2 15:53:17 2016
@@ -161,20 +161,15 @@ public class PositiveAndNegativeExampleP
             }
 
             String context = getTextBetween(systemView, mention1, mention2); 
-            String text = String.format("%s|%s\n", label, context);
+            String text = String.format("%s|%s", label, context);
             eventEventRelationsInSentence.add(text.toLowerCase());
           }
         }
 
-        if(eventEventRelationsInSentence.size() > 0) {
-          for(String text : eventEventRelationsInSentence) {
-            Path path = Paths.get(outputFile);
-            try {
-              Files.write(path, text.getBytes(), StandardOpenOption.APPEND);
-            } catch (IOException e) {
-              throw new AnalysisEngineProcessException(e);
-            }
-          }
+        try {
+          Files.write(Paths.get(outputFile), eventEventRelationsInSentence, StandardOpenOption.APPEND);
+        } catch (IOException e) {
+          e.printStackTrace();
         }
       }
     }



Mime
View raw message