public class TreeGraphNodeFactory extends Object implements TreeFactory
TreeGraphNodeFactory
acts as a factory for creating
nodes in a TreeGraph
. Unless
another LabelFactory
is
supplied, it will use a CoreLabelFactory
by default.Constructor and Description |
---|
TreeGraphNodeFactory()
Make a
TreeFactory that produces
TreeGraphNode s. |
TreeGraphNodeFactory(LabelFactory mlf) |
Modifier and Type | Method and Description |
---|---|
Tree |
newLeaf(Label label)
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 non-leaf 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 TreeGraphNodeFactory()
TreeFactory
that produces
TreeGraphNode
s. The labels are of class
CoreLabel
.public TreeGraphNodeFactory(LabelFactory mlf)
public Tree newLeaf(String word)
TreeFactory
String
passed in.newLeaf
in interface TreeFactory
word
- The word that will go into the tree label.public Tree newLeaf(Label label)
TreeFactory
newLeaf
in interface TreeFactory
label
- The label for the leaf nodepublic Tree newTreeNode(String parent, List<Tree> children)
TreeFactory
String
passed in.newTreeNode
in interface TreeFactory
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)
TreeFactory
newTreeNode
in interface TreeFactory
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