From b1ef8ab8137a8c1f585accdca3c02888c56b4909 Mon Sep 17 00:00:00 2001 From: John Bauer Date: Tue, 18 Jun 2024 01:01:53 -0700 Subject: [PATCH] Print out LOG FILE when printing the log file. Whitespace align some stuff --- .../stanford/nlp/dcoref/DcorefBenchmarkSlowITest.java | 9 ++++----- src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/itest/src/edu/stanford/nlp/dcoref/DcorefBenchmarkSlowITest.java b/itest/src/edu/stanford/nlp/dcoref/DcorefBenchmarkSlowITest.java index 57fa089823..e3b6dc31a6 100644 --- a/itest/src/edu/stanford/nlp/dcoref/DcorefBenchmarkSlowITest.java +++ b/itest/src/edu/stanford/nlp/dcoref/DcorefBenchmarkSlowITest.java @@ -49,15 +49,14 @@ private static String runCorefTest(boolean deleteOnExit) throws Exception { System.err.println("Current dir using System:" +currentDir); String[] corefArgs = { "-props", "edu/stanford/nlp/dcoref/coref.properties", - '-' + Constants.LOG_PROP, baseLogFile, - '-' + Constants.CONLL_OUTPUT_PROP, WORK_DIR_FILE.toString() }; + '-' + Constants.LOG_PROP, baseLogFile, + '-' + Constants.CONLL_OUTPUT_PROP, WORK_DIR_FILE.toString() }; Properties props = StringUtils.argsToProperties(corefArgs); - System.err.println("Running dcoref with properties:"); - System.err.println(props); + System.err.println("Running dcoref with properties:\n" + props); String logFile = SieveCoreferenceSystem.initializeAndRunCoref(props); - System.err.println(logFile); + System.err.println("LOG FILE: " + logFile); String actualResults = IOUtils.slurpFile(logFile); return actualResults; diff --git a/src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java b/src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java index 0830f4c090..5f4cc1cf76 100644 --- a/src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java +++ b/src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java @@ -347,13 +347,13 @@ public static String initializeAndRunCoref(Properties props) throws Exception { MentionExtractor mentionExtractor; if (props.containsKey(Constants.MUC_PROP)){ mentionExtractor = new MUCMentionExtractor(corefSystem.dictionaries, props, - corefSystem.semantics, corefSystem.singletonPredictor); + corefSystem.semantics, corefSystem.singletonPredictor); } else if(props.containsKey(Constants.ACE2004_PROP) || props.containsKey(Constants.ACE2005_PROP)) { mentionExtractor = new ACEMentionExtractor(corefSystem.dictionaries, props, - corefSystem.semantics, corefSystem.singletonPredictor); + corefSystem.semantics, corefSystem.singletonPredictor); } else if (props.containsKey(Constants.CONLL2011_PROP)) { mentionExtractor = new CoNLLMentionExtractor(corefSystem.dictionaries, props, - corefSystem.semantics, corefSystem.singletonPredictor); + corefSystem.semantics, corefSystem.singletonPredictor); } else { throw new RuntimeException("No input file specified!"); }