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(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 non-leaf tree node with the given label
|
Tree |
newTreeNode(String parent,
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(String word)
TreeFactory
String
passed in.newLeaf
in interface TreeFactory
newLeaf
in class SimpleTreeFactory
word
- The word that will go into the tree label.public Tree newLeaf(Label label)
newLeaf
in interface TreeFactory
newLeaf
in class SimpleTreeFactory
label
- the label for the leaf nodepublic Tree newTreeNode(String parent, List<Tree> children)
TreeFactory
String
passed in.newTreeNode
in interface TreeFactory
newTreeNode
in class SimpleTreeFactory
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
public Tree newTreeNode(Label parentLabel, List<Tree> children)
newTreeNode
in interface TreeFactory
newTreeNode
in class SimpleTreeFactory
parentLabel
- The label for the nodechildren
- A List
of the children of this node,
each of which should itself be a LabeledScoredTree