Example usage for Java edu.stanford.nlp.trees Tree fields, constructors, methods, implement or subclass
The text is from its open source code.
void | addChild(Tree t) Adds the tree t at the last index position among the daughters. |
void | addChild(int i, Tree t) Adds the tree t at the index position among the daughters. |
Tree | ancestor(int height, Tree root) Return the ancestor tree node height nodes up from the current node. |
Tree[] | children() Returns an array of children for the current node. |
Set | constituents() Returns the Constituents generated by the parse tree. |
Tree | deepCopy() Makes a deep copy of not only the Tree structure but of the labels as well. |
Tree | deepCopy(TreeFactory tf, LabelFactory lf) Makes a deep copy of not only the Tree structure but of the labels as well. |
int | depth() Finds the depth of the tree. |
boolean | dominates(Tree t) Returns true if this dominates the Tree passed in as an argument. |
List | dominationPath(Tree t) Returns the path of nodes leading down to a dominated node, including this and the dominated node itself. |
boolean | equals(Object o) Implements equality for Tree's. |
Tree | firstChild() Returns the first child of a tree, or null if none. |
Tree | getChild(int i) Return the child at some daughter index. |
List | getChildrenAsList() Returns a List of children for the current node. |
List | getLeaves() Gets the leaves of the tree. |
Tree | getNodeNumber(int i) Fetches the i th node in the tree, with node numbers defined as in #nodeNumber(Tree) . |
IntPair | getSpan() Returns SpanAnnotation of this node, or null if annotation is not assigned. |
Tree | headPreTerminal(HeadFinder hf) Returns the preterminal tree that is the head of the tree. |
Tree | headTerminal(HeadFinder hf) Returns the tree leaf that is the head of the tree. |
void | indentedListPrint() Indented list printing of a tree. |
void | indexLeaves() Assign sequential integer indices to the leaves of the tree rooted at this Tree , starting with 1. |
void | indexSpans() Index all spans (constituents) in the tree. |
void | indexSpans(int startIndex) |
Pair | indexSpans(MutableInteger startIndex) Assigns span indices (BeginIndexAnnotation and EndIndexAnnotation) to all nodes in a tree. |
boolean | isLeaf() Says whether a node is a leaf. |
boolean | isPhrasal() Return whether this node is a phrasal node or not. |
boolean | isPrePreTerminal() Return whether all the children of this node are preterminals or not. |
boolean | isPreTerminal() Return whether this node is a preterminal or not. |
Iterator | iterator() Returns an iterator over all the nodes of the tree. |
Label | label() Returns the label associated with the current node, or null if there is no label. |
List | labeledYield() |
Tree | lastChild() Returns the last child of a tree, or null if none. |
int | leftCharEdge(Tree node) Returns the positional index of the left edge of node within the tree, as measured by characters. |
int | nodeNumber(Tree root) Calculates the node's number, defined as the number of nodes traversed in a left-to-right, depth-first search of the tree starting at root and ending at this . |
String | nodeString() Returns the value of the node's label as a String. |
int | numChildren() Says how many children a tree node has in its local tree. |
int | objectIndexOf(Tree tree) Returns the position of a Tree in the children list, if present, or -1 if it is not present. |
Tree | parent(Tree root) Return the parent of the tree node. |
List | pathNodeToNode(Tree t1, Tree t2) Given nodes t1 and t2 which are dominated by this node, returns a list of all the nodes on the path from t1 to t2, inclusive, or null if none found. |
void | pennPrint() Print the tree as done in Penn Treebank merged files. |
void | pennPrint(PrintWriter pw) Print the tree as done in Penn Treebank merged files. |
void | pennPrint(PrintStream ps) Print the tree as done in Penn Treebank merged files. |
String | pennString() Calls pennPrint() and saves output to a String |
List | preOrderNodeList() |
List | preTerminalYield() Gets the preterminal yield (i.e., tags) of the tree. |
Tree | prune(final Predicate Creates a deep copy of the tree, where all nodes that the filter does not accept and all children of such nodes are pruned. |
Tree | removeChild(int i) Destructively removes the child at some daughter index and returns it. |
int | rightCharEdge(Tree node) Returns the positional index of the right edge of node within the tree, as measured by characters. |
double | score() Returns the score associated with the current node, or NaN if there is no score. |
Tree | setChild(int i, Tree t) Replaces the i th child of this with the tree t. |
void | setChildren(Tree[] children) Set the children of this node to be the children given in the array. |
void | setChildren(List extends Tree> childTreesList) Set the children of this tree node to the given list. |
void | setLabel(Label label) Sets the label associated with the current node, if there is one. |
void | setScore(double score) Sets the score associated with the current node, if there is one. |
void | setSpans() Assign a SpanAnnotation on each node of this tree. |
void | setValue(String value) |
List | siblings(Tree root) Returns the siblings of this Tree node. |
int | size() Returns the number of nodes the tree contains. |
Tree | skipRoot() Returns first child if this is unary and if the label at the current node is either "ROOT" or empty. |
List | subTreeList() Get the list of all subtrees inside the tree by returning a tree rooted at each node. |
List | taggedLabeledYield() Returns a List |
ArrayList | taggedYield() Gets the tagged yield of the tree. |
String | toString() Converts parse tree to string in Penn Treebank format. |
StringBuilder | toStringBuilder(StringBuilder sb) Appends the printed form of a parse tree (as a bracketed String) to a StringBuilder . |
Tree | transform(final TreeTransformer transformer) Create a transformed Tree. |
TreeFactory | treeFactory() Return a TreeFactory that produces trees of the appropriate type. |
String | value() |
Tree | valueOf(String str) This gives you a tree from a String representation (as a bracketed Tree, of the kind produced by toString() , pennPrint() , or as in the Penn Treebank). |
ArrayList | yield() Gets the yield of the tree. |
ArrayList | yieldWords() |