Skip to content

Commit f16b16e

Browse files
committed
Simplify - remove duplicate CoNLLUTagUpdater script (only difference being, write to disk or write to stdout)
1 parent 7399e9b commit f16b16e

File tree

2 files changed

+10
-40
lines changed

2 files changed

+10
-40
lines changed

src/edu/stanford/nlp/parser/nndep/CoNLLUTagUpdater.java

-40
This file was deleted.

src/edu/stanford/nlp/trees/ud/CoNLLUTagUpdater.java

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
import java.io.*;
88
import java.util.*;
99

10+
/**
11+
* Load a CoNLL-U file, retag it using the specified tagger, and output back to stdout
12+
*
13+
* @author Jason Bolton
14+
*/
1015
public class CoNLLUTagUpdater {
1116

1217
public static MaxentTagger maxentTagger;
@@ -19,9 +24,14 @@ public static void main(String[] args) throws ClassNotFoundException, IOExceptio
1924
System.err.println("Reading in docs...");
2025
List<Annotation> docs = reader.readCoNLLUFile(filePath);
2126
System.err.println("Done.");
27+
2228
System.err.println("Tagging docs...");
2329
String taggerPath = props.getProperty("tagger");
2430
maxentTagger = new MaxentTagger(taggerPath);
31+
32+
// output each doc to stdout
33+
// multiple documents could occur if the reader splits the conll-u file
34+
// at a #newdoc comment
2535
for (Annotation doc : docs) {
2636
CoreDocument coreDoc = new CoreDocument(doc);
2737
for (CoreSentence sentence : coreDoc.sentences()) {

0 commit comments

Comments
 (0)