}
private void writeNonTerminals(PhraseStructure phraseStructure) throws MaltChainedException {
for (int index : nonTerminalIndexMap.keySet()) {
// for (int index : phraseStructure.getNonTerminalIndices()) {
NonTerminalNode nonTerminal = (NonTerminalNode)phraseStructure.getNonTerminalNode(index);
if (nonTerminal == null || nonTerminal.isRoot()) {
return;
}
try {
writer.write('#');
// writer.write(Integer.toString(index+START_ID_OF_NONTERMINALS-1));
writer.write(Integer.toString(nonTerminalIndexMap.get(index)));
writer.write("\t\t\t--\t\t\t");
if (nonTerminal.hasLabel(dataFormatInstance.getColumnDescriptionByName("CAT").getSymbolTable())) {
writer.write(nonTerminal.getLabelSymbol(dataFormatInstance.getColumnDescriptionByName("CAT").getSymbolTable()));
} else {
writer.write("--");
}
writer.write("\t--\t\t");
if (nonTerminal.hasParentEdgeLabel(dataFormatInstance.getColumnDescriptionByName("LABEL").getSymbolTable())) {
writer.write(nonTerminal.getParentEdgeLabelSymbol(dataFormatInstance.getColumnDescriptionByName("LABEL").getSymbolTable()));
} else {
writer.write("--");
}
writer.write('\t');
if (nonTerminal.getParent() == null || nonTerminal.getParent().isRoot()) {
writer.write('0');
} else {
// writer.write(Integer.toString(nonTerminal.getParent().getIndex()+START_ID_OF_NONTERMINALS-1));
writer.write(Integer.toString(nonTerminalIndexMap.get(nonTerminal.getParent().getIndex())));
}
for (Edge e : nonTerminal.getIncomingSecondaryEdges()) {
if (e.hasLabel(dataFormatInstance.getColumnDescriptionByName("SECEDGELABEL").getSymbolTable())) {
writer.write('\t');
writer.write(e.getLabelSymbol(dataFormatInstance.getColumnDescriptionByName("SECEDGELABEL").getSymbolTable()));
writer.write('\t');
if (e.getSource() instanceof NonTerminalNode) {