Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.stanford.nlp.trees
Class LabeledScoredTreeFactory

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

All Implemented Interfaces:
  TreeFactory

    public class LabeledScoredTreeFactory

extends SimpleTreeFactory

A `LabeledScoredTreeFactory` acts as a factory for creating trees with labels and scores. Unless another `LabelFactory` is supplied, it will use a `StringLabel` by default.

Author:
  Christopher Manning

Constructor Summary
`LabeledScoredTreeFactory()` Make a TreeFactory that produces LabeledScoredTree trees.
`LabeledScoredTreeFactory(LabelFactory lf)` Make a treefactory that uses LabeledScoredTree trees, where the labels are as specified by the user.

Method Summary
`Tree` | `newLeaf(Label label)` Create a new 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 children)` Create a new non-leaf tree node with the given label
`Tree` | `newTreeNode(String parent, List 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

### LabeledScoredTreeFactory

    public LabeledScoredTreeFactory()

  Make a TreeFactory that produces LabeledScoredTree trees. The labels are of class `StringLabel`.

### LabeledScoredTreeFactory

    public LabeledScoredTreeFactory(LabelFactory lf)

  Make a treefactory that uses LabeledScoredTree trees, where the labels are as specified by the user.

  Parameters:
    `lf` - the `LabelFactory` to be used to create labels

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`
  Overrides:
    `newLeaf` in class `SimpleTreeFactory`
  Parameters:
    `word` - The word that will go into the tree label.
  Returns:
    The new leaf

### newLeaf

    public Tree newLeaf(Label label)

  Create a new leaf node with the given label

  Specified by:
    `newLeaf` in interface `TreeFactory`
  Overrides:
    `newLeaf` in class `SimpleTreeFactory`
  Parameters:
    `label` - the label for the leaf node
  Returns:
    A new tree leaf

### newTreeNode

    public Tree newTreeNode(String parent,
                            List 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`
  Overrides:
    `newTreeNode` in class `SimpleTreeFactory`
  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 children)

  Create a new non-leaf tree node with the given label

  Specified by:
    `newTreeNode` in interface `TreeFactory`
  Overrides:
    `newTreeNode` in class `SimpleTreeFactory`
  Parameters:
    `parentLabel` - The label for the node
    `children` - A `List` of the children of this node, each of which should itself be a `LabeledScoredTree`
  Returns:
    A new internal tree node

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Stanford NLP Group