Skip to content

Commit

Permalink
Fix apostrophe error
Browse files Browse the repository at this point in the history
  • Loading branch information
ili3p committed Nov 7, 2015
1 parent 8d10c12 commit 5ee603a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ PDTB parser based on:
<cite> Ziheng Lin, Hwee Tou Ng and Min-Yen Kan (2014).<b> A PDTB-Styled End-to-End Discourse Parser</b>. Natural Language Engineering, 20, pp 151-184. Cambridge University Press.</cite>

Developer: [Ilija Ilievski](http://ilija139.github.io/)<br>
Version: 2.0.1 <br>
Last update: 27-Oct-2015
Version: 2.0.2 <br>
Last update: 7-Nov-2015

Requires Java 1.7+. Tested only on Mac and Linux OS.

Expand Down
Binary file modified runnable_jars/pdtb-parser.tar.gz
Binary file not shown.
5 changes: 4 additions & 1 deletion src/sg/edu/nus/comp/pdtb/runners/SpanTreeExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ public static void anyTextToSpanGen(File treeFile, File inputFile) throws IOExce
log.info("Generating the spans of each node in the parse trees.");

String orgText = Util.readFile(inputFile);
orgText = orgText.replaceAll("`", "'").replaceAll("“", "\"");
orgText = orgText.replaceAll("`", "'").replaceAll("“", "\"").replaceAll("’", "'");
;
PrintWriter pw = new PrintWriter(treeFile + ".csv");
TreeFactory tf = new LabeledScoredTreeFactory();
Reader r = new BufferedReader(new InputStreamReader(new FileInputStream(treeFile), Util.ENCODING));
Expand All @@ -164,8 +165,10 @@ public static void anyTextToSpanGen(File treeFile, File inputFile) throws IOExce
}
String word = nodeToString(leaf).trim();
word = word.replaceAll("`", "'");
word = word.replaceAll("’", "'");
word = word.replaceAll("\\.\\.\\.", ". . .");
int span = orgText.indexOf(word, index);

if (span == -1) {
continue;
}
Expand Down

0 comments on commit 5ee603a

Please sign in to comment.