You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by dl...@apache.org on 2016/06/02 15:53:17 UTC
svn commit: r1746597 -
/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/pipelines/PositiveAndNegativeExamplePrinter.java
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();
}
}
}