try {
c = reader.read();
} catch (IOException e) {
close();
throw new DataFormatException("Error when reading from the input file. ", e);
}
if (c == TAB || c == NEWLINE || c == CARRIAGE_RETURN || c == -1) {
if (input.length() != 0) {
if (i == 0) {
terminalCounter++;
node = syntaxGraph.addTokenNode(terminalCounter);
}
if (columns.hasNext()) {
ColumnDescription column = columns.next();
if (column.getCategory() == ColumnDescription.INPUT && node != null) {
syntaxGraph.addLabel(node, column.getName(), input.toString());
} else if (column.getCategory() == ColumnDescription.HEAD) {
if (syntaxGraph instanceof DependencyStructure) {
if (column.getCategory() != ColumnDescription.IGNORE && !input.toString().equals(IGNORE_COLUMN_SIGN)) {
// if (column.getType() != ColumnDescription.IGNORE && !input.toString().equals(IGNORE_COLUMN_SIGN)) { // bugfix
//if (!input.toString().equals(IGNORE_COLUMN_SIGN)) {
edge = ((DependencyStructure)syntaxGraph).addDependencyEdge(Integer.parseInt(input.toString()), terminalCounter);
}
}
else {
close();
throw new DataFormatException("The input graph is not a dependency graph and therefore it is not possible to add dependncy edges. ");
}
} else if (column.getCategory() == ColumnDescription.DEPENDENCY_EDGE_LABEL && edge != null) {
//if (column.getType() != ColumnDescription.IGNORE && !input.toString().equals(IGNORE_COLUMN_SIGN)) { // bugfix not working for everybody
syntaxGraph.addLabel(edge, column.getName(), input.toString());
//} // bugfix