@Override public String nodeString() { StringBuilder buff = new StringBuilder(); buff.append(super.nodeString()); if ( ! Double.isNaN(score)) { buff.append(" [").append(nf.format(-score)).append(']'); } return buff.toString(); } }
String head = null; if (mentionTree != null) { head = mentionTree.headTerminal(headFinder).nodeString(); } else if (mention.first.equals(mention.second)) { head = word;
String head = null; if (mentionTree != null) { head = mentionTree.headTerminal(headFinder).nodeString(); } else if (mention.first.equals(mention.second)) { head = word;
@Override public String nodeString() { StringBuilder buff = new StringBuilder(); buff.append(super.nodeString()); if ( ! Double.isNaN(score)) { buff.append(" [").append(nf.format(-score)).append(']'); } return buff.toString(); } }
@Override public String nodeString() { StringBuilder buff = new StringBuilder(); buff.append(super.nodeString()); if ( ! Double.isNaN(score)) { buff.append(" [").append(nf.format(-score)).append("]"); } return buff.toString(); } }
@Override public String nodeString() { StringBuilder buff = new StringBuilder(); buff.append(super.nodeString()); if ( ! Double.isNaN(score)) { buff.append(" [").append(nf.format(-score)).append(']'); } return buff.toString(); } }
@Override public String nodeString() { StringBuilder buff = new StringBuilder(); buff.append(super.nodeString()); if ( ! Double.isNaN(score)) { buff.append(" [").append(nf.format(-score)).append("]"); } return buff.toString(); } }
public void output(Tree tree) { System.out.println(tree.nodeString()); for(int i = 0; i < tree.numChildren(); i++) { output(tree.children()[i]); } }
/** * Display a node, implementing Penn Treebank style layout */ private void display(int indent, boolean parentLabelNull, boolean firstSibling, boolean leftSiblingPreTerminal, boolean topLevel, PrintWriter pw) { // the condition for staying on the same line in Penn Treebank boolean suppressIndent = (parentLabelNull || (firstSibling && isPreTerminal()) || (leftSiblingPreTerminal && isPreTerminal() && (label() == null || !label().value().startsWith("CC")))); if (suppressIndent) { pw.print(" "); // pw.flush(); } else { if (!topLevel) { pw.println(); } for (int i = 0; i < indent; i++) { pw.print(" "); // pw.flush(); } } if (isLeaf() || isPreTerminal()) { pw.print(toString()); pw.flush(); return; } pw.print("("); pw.print(nodeString()); // pw.flush(); displayChildren(children(), indent + 1, label() == null || label().value() == null, pw); pw.print(")"); pw.flush(); }
nodeString = (value == null) ? "" : value; } else { nodeString = nodeString();
Tree mentionTree = treeSpanMap.get(mention); if (mentionTree != null){ head = mentionTree.headTerminal(headFinder).nodeString();
String head = null; if (mentionTree != null) { head = mentionTree.headTerminal(headFinder).nodeString(); } else if (mention.first.equals(mention.second)) { head = word;
String head = null; if (mentionTree != null) { head = mentionTree.headTerminal(headFinder).nodeString(); } else if (mention.first.equals(mention.second)) { head = word;
String head = null; if (mentionTree != null) { head = mentionTree.headTerminal(headFinder).nodeString(); } else if (mention.first.equals(mention.second)) { head = word;
sentences = document.get(CoreAnnotations.SentencesAnnotation.class); if (sentences.get(0).get(TreeCoreAnnotations.TreeAnnotation.class).nodeString().equals("X")) {
/** * Takes a Stanford Tree and Curator Tree and recursively populates the Curator Tree to match * the Stanford Tree. Returns the top Node of the tree. * * @param parse Stanford Tree * @return top Node of the Tree */ private static Tree<String> generateNode(edu.stanford.nlp.trees.Tree parse) { Tree<String> node = new Tree<>(parse.value()); for (edu.stanford.nlp.trees.Tree pt : parse.getChildrenAsList()) { if (pt.isLeaf()) { node.addLeaf(pt.nodeString()); } else { // generate child of parse, the current node in tree node.addSubtree(generateNode(pt)); } } return node; }
/** * Takes a Stanford Tree and Curator Tree and recursively populates the Curator Tree to match * the Stanford Tree. Returns the top Node of the tree. * * @param parse Stanford Tree * @return top Node of the Tree */ private static Tree<String> generateNode(edu.stanford.nlp.trees.Tree parse) { Tree<String> node = new Tree<>(parse.value()); for (edu.stanford.nlp.trees.Tree pt : parse.getChildrenAsList()) { if (pt.isLeaf()) { node.addLeaf(pt.nodeString()); } else { // generate child of parse, the current node in tree node.addSubtree(generateNode(pt)); } } return node; }
sentences = document.get(CoreAnnotations.SentencesAnnotation.class); if (sentences.get(0).get(TreeCoreAnnotations.TreeAnnotation.class).nodeString().equals("X")) {
parseAnnotator.annotate(document); sentences = document.get(CoreAnnotations.SentencesAnnotation.class); if (sentences.get(0).get(TreeCoreAnnotations.TreeAnnotation.class).nodeString().equals("X")) {
parseAnnotator.annotate(document); sentences = document.get(CoreAnnotations.SentencesAnnotation.class); if (sentences.get(0).get(TreeCoreAnnotations.TreeAnnotation.class).nodeString().equals("X")) {