public class OrderedCombinationTreeNormalizer extends TreeNormalizer
Constructor and Description |
---|
OrderedCombinationTreeNormalizer() |
OrderedCombinationTreeNormalizer(List<TreeNormalizer> tns) |
Modifier and Type | Method and Description |
---|---|
void |
addTreeNormalizer(TreeNormalizer tn)
Adds the given tree normalizer to this combination; the tree normalizers
are applied in the order they were added, with the first to be added being
the first to be applied.
|
String |
normalizeNonterminal(String category)
Normalizes a nonterminal contents (and maybe intern it).
|
String |
normalizeTerminal(String leaf)
Normalizes a leaf contents (and maybe intern it).
|
Tree |
normalizeWholeTree(Tree tree,
TreeFactory tf)
Normalize a whole tree -- this method assumes that the argument
that it is passed is the root of a complete
Tree . |
public OrderedCombinationTreeNormalizer()
public OrderedCombinationTreeNormalizer(List<TreeNormalizer> tns)
public void addTreeNormalizer(TreeNormalizer tn)
public String normalizeNonterminal(String category)
TreeNormalizer
normalizeNonterminal
in class TreeNormalizer
category
- The String that decorates this nonterminal nodepublic String normalizeTerminal(String leaf)
TreeNormalizer
normalizeTerminal
in class TreeNormalizer
leaf
- The String that decorates the leafpublic Tree normalizeWholeTree(Tree tree, TreeFactory tf)
TreeNormalizer
Tree
.
It is normally implemented as a Tree-walking routine.
This method may return null
. This is interpreted to
mean that this is a tree that should not be included in further
processing. PennTreeReader recognizes this return value, and
asks for another Tree from the input Reader.
normalizeWholeTree
in class TreeNormalizer
tree
- The tree to be normalizedtf
- the TreeFactory to create new nodes (if needed)