public class LabeledScoredTreeFactory extends SimpleTreeFactory
LabeledScoredTreeFactory acts as a factory for creating
trees with labels and scores. Unless another LabelFactory
is supplied, it will use a CoreLabel by default.| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
Tree |
newLeaf(Label label)
Create a new leaf node with the given label
|
Tree |
newLeaf(java.lang.String word)
Create a new tree leaf node, where the label is formed from
the
String passed in. |
Tree |
newTreeNode(Label parentLabel,
java.util.List<Tree> children)
Create a new non-leaf tree node with the given label
|
Tree |
newTreeNode(java.lang.String parent,
java.util.List<Tree> children)
Create a new tree non-leaf node, where the label is formed from
the
String passed in. |
public LabeledScoredTreeFactory()
CoreLabel.public LabeledScoredTreeFactory(LabelFactory lf)
lf - the LabelFactory to be used to create labelspublic Tree newLeaf(java.lang.String word)
TreeFactoryString passed in.newLeaf in interface TreeFactorynewLeaf in class SimpleTreeFactoryword - The word that will go into the tree label.public Tree newLeaf(Label label)
newLeaf in interface TreeFactorynewLeaf in class SimpleTreeFactorylabel - the label for the leaf nodepublic Tree newTreeNode(java.lang.String parent, java.util.List<Tree> children)
TreeFactoryString passed in.newTreeNode in interface TreeFactorynewTreeNode in class SimpleTreeFactoryparent - 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
nullpublic Tree newTreeNode(Label parentLabel, java.util.List<Tree> children)
newTreeNode in interface TreeFactorynewTreeNode in class SimpleTreeFactoryparentLabel - The label for the nodechildren - A List of the children of this node,
each of which should itself be a LabeledScoredTree