Skip to content

Commit

Permalink
Print out LOG FILE when printing the log file. Whitespace align some …
Browse files Browse the repository at this point in the history
…stuff
  • Loading branch information
AngledLuffa committed Jun 18, 2024
1 parent 074724f commit b1ef8ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
Expand Down

0 comments on commit b1ef8ab

Please sign in to comment.