/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. */ public void indentedListPrint() { indentedListPrint(new PrintWriter(System.out, true), false); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ public void indentedListPrint(PrintWriter pw, boolean printScores) { indentedListPrint("", makeIndentString(indentIncr), pw, printScores); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * String parameters are used rather than integer levels for efficiency. * * @param indent The base {@code String} (normally just spaces) * to print before each line of tree * @param pad The additional {@code String} (normally just more * spaces) to add when going to a deeper level of {@code Tree}. * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ private void indentedListPrint(String indent, String pad, PrintWriter pw, boolean printScores) { StringBuilder sb = new StringBuilder(indent); Label label = label(); if (label != null) { sb.append(label); } if (printScores) { sb.append(" "); sb.append(score()); } pw.println(sb); Tree[] children = children(); String newIndent = indent + pad; for (Tree child : children) { child.indentedListPrint(newIndent, pad, pw, printScores); } }
StringWriter sw = new StringWriter(); PrintWriter psw = new PrintWriter(sw); outputTree.indentedListPrint(psw,false); pw.print(XMLUtils.escapeXML(sw.toString())); pw.println(".]"); outputTree.indentedListPrint(pw,false); pw.println(".]");
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. */ public void indentedListPrint() { indentedListPrint(new PrintWriter(System.out, true), false); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with nodel labels followed by node scores. */ public void indentedListPrint() { indentedListPrint(new PrintWriter(System.out, true), false); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. */ public void indentedListPrint() { indentedListPrint(new PrintWriter(System.out, true), false); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. */ public void indentedListPrint() { indentedListPrint(new PrintWriter(System.out, true), false); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ public void indentedListPrint(PrintWriter pw, boolean printScores) { indentedListPrint("", makeIndentString(indentIncr), pw, printScores); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ public void indentedListPrint(PrintWriter pw, boolean printScores) { indentedListPrint("", makeIndentString(indentIncr), pw, printScores); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ public void indentedListPrint(PrintWriter pw, boolean printScores) { indentedListPrint("", makeIndentString(indentIncr), pw, printScores); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with nodel labels followed by node scores. * * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ public void indentedListPrint(PrintWriter pw, boolean printScores) { indentedListPrint("", makeIndentString(indentIncr), pw, printScores); }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with nodel labels followed by node scores. * String parameters are used rather than integer levels for efficiency. * * @param indent The base <code>String</code> (normally just spaces) * to print before each line of tree * @param pad The additional <code>String</code> (normally just more * spaces) to add when going to a deeper level of <code>Tree</code>. * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ private void indentedListPrint(String indent, String pad, PrintWriter pw, boolean printScores) { StringBuilder sb = new StringBuilder(indent); Label label = label(); if (label != null) { sb.append(label.toString()); } if (printScores) { sb.append(" "); sb.append(score()); } pw.println(sb.toString()); Tree[] children = children(); String newIndent = indent + pad; for (int i = 0, n = children.length; i < n; i++) { children[i].indentedListPrint(newIndent, pad, pw, printScores); } }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * String parameters are used rather than integer levels for efficiency. * * @param indent The base {@code String} (normally just spaces) * to print before each line of tree * @param pad The additional {@code String} (normally just more * spaces) to add when going to a deeper level of {@code Tree}. * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ private void indentedListPrint(String indent, String pad, PrintWriter pw, boolean printScores) { StringBuilder sb = new StringBuilder(indent); Label label = label(); if (label != null) { sb.append(label); } if (printScores) { sb.append(" "); sb.append(score()); } pw.println(sb); Tree[] children = children(); String newIndent = indent + pad; for (Tree child : children) { child.indentedListPrint(newIndent, pad, pw, printScores); } }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * String parameters are used rather than integer levels for efficiency. * * @param indent The base {@code String} (normally just spaces) * to print before each line of tree * @param pad The additional {@code String} (normally just more * spaces) to add when going to a deeper level of {@code Tree}. * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ private void indentedListPrint(String indent, String pad, PrintWriter pw, boolean printScores) { StringBuilder sb = new StringBuilder(indent); Label label = label(); if (label != null) { sb.append(label); } if (printScores) { sb.append(" "); sb.append(score()); } pw.println(sb); Tree[] children = children(); String newIndent = indent + pad; for (Tree child : children) { child.indentedListPrint(newIndent, pad, pw, printScores); } }
/** * Indented list printing of a tree. The tree is printed in an * indented list notation, with node labels followed by node scores. * String parameters are used rather than integer levels for efficiency. * * @param indent The base <code>String</code> (normally just spaces) * to print before each line of tree * @param pad The additional <code>String</code> (normally just more * spaces) to add when going to a deeper level of <code>Tree</code>. * @param pw The PrintWriter to print the tree to * @param printScores Whether to print the scores (log probs) of tree nodes */ private void indentedListPrint(String indent, String pad, PrintWriter pw, boolean printScores) { StringBuilder sb = new StringBuilder(indent); Label label = label(); if (label != null) { sb.append(label.toString()); } if (printScores) { sb.append(" "); sb.append(score()); } pw.println(sb.toString()); Tree[] children = children(); String newIndent = indent + pad; for (Tree child : children) { child.indentedListPrint(newIndent, pad, pw, printScores); } }
StringWriter sw = new StringWriter(); PrintWriter psw = new PrintWriter(sw); outputTree.indentedListPrint(psw,false); pw.print(XMLUtils.escapeXML(sw.toString())); pw.println(".]"); outputTree.indentedListPrint(pw,false); pw.println(".]");
StringWriter sw = new StringWriter(); PrintWriter psw = new PrintWriter(sw); outputTree.indentedListPrint(psw,false); pw.print(XMLUtils.escapeXML(sw.toString())); pw.println(".]"); outputTree.indentedListPrint(pw,false); pw.println(".]");
StringWriter sw = new StringWriter(); PrintWriter psw = new PrintWriter(sw); outputTree.indentedListPrint(psw,false); pw.print(XMLUtils.escapeXML(sw.toString())); pw.println(".]"); outputTree.indentedListPrint(pw,false); pw.println(".]");
StringWriter sw = new StringWriter(); PrintWriter psw = new PrintWriter(sw); outputTree.indentedListPrint(psw,false); pw.print(XMLUtils.escapeXML(sw.toString())); pw.println(".]"); outputTree.indentedListPrint(pw,false); pw.println(".]");