## edu.stanford.nlp.trees
Class SimpleTreeFactory

    java.lang.Object
      edu.stanford.nlp.trees.SimpleTreeFactory

All Implemented Interfaces:
  TreeFactory

Direct Known Subclasses:
  LabeledScoredTreeFactory

    public class SimpleTreeFactory

extends Object
implements TreeFactory

A `SimpleTreeFactory` acts as a factory for creating objects of class `SimpleTree`.

NB: A SimpleTree stores tree geometries but no node labels. Make sure this is what you really want.

Author:
  Christopher Manning

Constructor Summary
`SimpleTreeFactory()` Creates a new `TreeFactory`.
`SimpleTreeFactory(LabelFactory lf)` Creates a new `TreeFactory`.

Method Summary
`Tree` `newLeaf(Label word)` Create a new tree leaf node, with the given label.
`Tree` `newLeaf(String word)` Create a new tree leaf node, where the label is formed from the `String` passed in.
`Tree` `newTreeNode(Label parentLabel, List<Tree> children)` Create a new tree nonleaf node, with the given label.
`Tree` `newTreeNode(String parent, List<Tree> children)` Create a new tree nonleaf node, where the label is formed from the `String` passed in.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimpleTreeFactory

    public SimpleTreeFactory()

  Creates a new `TreeFactory`. A `SimpleTree` stores no `Label`, so no `LabelFactory` is built.

### SimpleTreeFactory

    public SimpleTreeFactory(LabelFactory lf)

  Creates a new `TreeFactory`. A `SimpleTree` stores no `Label`, so the `LabelFactory` argument is ignored.

  Parameters:
    `lf` - This argument is ignored

Method Detail

### newLeaf

    public Tree newLeaf(String word)

  Description copied from interface: `TreeFactory`
  Create a new tree leaf node, where the label is formed from the `String` passed in.

  Specified by:
    `newLeaf` in interface `TreeFactory`
  Parameters:
    `word` - The word that will go into the tree label.
  Returns:
    The new leaf

### newLeaf

    public Tree newLeaf(Label word)

  Description copied from interface: `TreeFactory`
  Create a new tree leaf node, with the given label.

  Specified by:
    `newLeaf` in interface `TreeFactory`
  Parameters:
    `word` - The label for the leaf node
  Returns:
    The new leaf

### newTreeNode

    public Tree newTreeNode(String parent,
                            List<Tree> children)

  Description copied from interface: `TreeFactory`
  Create a new tree nonleaf node, where the label is formed from the `String` passed in.

  Specified by:
    `newTreeNode` in interface `TreeFactory`
  Parameters:
    `parent` - The string that will go into the parent tree label.
    `children` - The list of daughters of this tree. The children may be a (possibly empty) `List` of children or `null`
  Returns:
    The new interior tree node

### newTreeNode

    public Tree newTreeNode(Label parentLabel,
                            List<Tree> children)

  Description copied from interface: `TreeFactory`
  Create a new tree nonleaf node, with the given label.

  Specified by:
    `newTreeNode` in interface `TreeFactory`
  Parameters:
    `parentLabel` - The label for the parent tree node.
    `children` - The list of daughters of this tree. The children may be a (possibly empty) `List` of children or `null`
  Returns:
    The new interior tree node

Stanford NLP Group