edu.stanford.nlp.trees
Class SimpleTree

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--edu.stanford.nlp.trees.Tree
              |
              +--edu.stanford.nlp.trees.SimpleTree
All Implemented Interfaces:
Collection, Labeled, Scored

public class SimpleTree
extends Tree

A SimpleTree is a minimal concrete implementation of an unlabeled, unscored Tree. It has a tree structure, but no annotation at nodes.


Constructor Summary
SimpleTree()
          Create an empty parse tree.
SimpleTree(Label label)
          Create parse tree with given root and null daughters.
SimpleTree(Label label, List daughterTreesList)
          Create parse tree with given root and array of daughter trees.
 
Method Summary
 Tree[] children()
          Returns an array of children for the current node, or null if it is a leaf.
static TreeFactory factory()
          Return a TreeFactory that produces trees of the SimpleTree type.
 void setChildren(Tree[] children)
          Set the children of this node to be the children given in the array.
 TreeFactory treeFactory()
          Return a TreeFactory that produces trees of the SimpleTree type.
 
Methods inherited from class edu.stanford.nlp.trees.Tree
constituents, constituents, deepCopy, deepCopy, depth, firstChild, getChildrenAsList, indentedListPrint, indentedListPrint, isLeaf, isPreTerminal, iterator, label, labels, lastChild, parent, parent, pennPrint, pennPrint, percolateHeads, preTerminalYield, preTerminalYield, prune, prune, score, setChildren, setLabel, setLabels, setScore, size, spliceOut, spliceOut, subTrees, subTrees, taggedYield, taggedYield, toString, toStringBuffer, transform, transform, yield, yield
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

SimpleTree

public SimpleTree()
Create an empty parse tree.


SimpleTree

public SimpleTree(Label label)
Create parse tree with given root and null daughters.

Parameters:
label - root label of new tree to construct. For a SimpleTree this parameter is ignored.

SimpleTree

public SimpleTree(Label label,
                  List daughterTreesList)
Create parse tree with given root and array of daughter trees.

Parameters:
label - root label of tree to construct. For a SimpleTree this parameter is ignored
daughterTreesList - list of daughter trees to construct.
Method Detail

children

public Tree[] children()
Returns an array of children for the current node, or null if it is a leaf.

Specified by:
children in class Tree
Returns:
The children of the node
See Also:
Tree.getChildrenAsList()

setChildren

public void setChildren(Tree[] children)
Description copied from class: Tree
Set the children of this node to be the children given in the array. The children array may be either an array of length 0 or null if there are no children, and other methods in this class work on either representation.

Specified by:
setChildren in class Tree
Parameters:
children - The array of children, each a Tree
See Also:
Tree.setChildren(List)

treeFactory

public TreeFactory treeFactory()
Return a TreeFactory that produces trees of the SimpleTree type. The factory returned is always the same one (a singleton).

Specified by:
treeFactory in class Tree
Returns:
a factory to produce simple (unlabelled) trees

factory

public static TreeFactory factory()
Return a TreeFactory that produces trees of the SimpleTree type. The factory returned is always the same one (a singleton).

Returns:
a factory to produce simple (unlabelled) trees


Stanford NLP Group