Skip to content

Commit c161916

Browse files
committed
Oops, introduced a bug when there's no enhanced graph
1 parent b3f8f97 commit c161916

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/edu/stanford/nlp/pipeline/CoNLLUReader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ public CoreMap convertCoNLLUSentenceToCoreMap(CoNLLUDocument doc, CoNLLUSentence
557557
for (int i = 0; i < lines.size(); i++) {
558558
List<String> fields = Arrays.asList(lines.get(i).split("\t"));
559559
// track whether any of these lines signify there is an enhanced graph
560-
hasEnhanced = hasEnhanced || !fields.equals("_");
560+
hasEnhanced = hasEnhanced || !fields.get(CoNLLU_EnhancedField).equals("_");
561561
// skip the ROOT node
562562
if (fields.get(CoNLLU_GovField).equals("0"))
563563
continue;
@@ -579,10 +579,12 @@ public CoreMap convertCoNLLUSentenceToCoreMap(CoNLLUDocument doc, CoNLLUSentence
579579
allLines.addAll(lines);
580580
allLines.addAll(sentence.emptyLines);
581581
for (String line : allLines) {
582+
System.out.println(line);
582583
List<String> fields = Arrays.asList(line.split("\t"));
583584
IndexedWord dependent = graphNodes.get(fields.get(CoNLLU_IndexField));
584585
String[] arcs = fields.get(CoNLLU_EnhancedField).split("[|]");
585586
for (String arc : arcs) {
587+
System.out.println(arc);
586588
String[] arcPieces = arc.split(":", 2);
587589
if (arcPieces[0].equals("0")) {
588590
roots.add(dependent);

0 commit comments

Comments
 (0)