edu.stanford.nlp.trees
Class OrderedCombinationTreeNormalizer

java.lang.Object
  extended by edu.stanford.nlp.trees.TreeNormalizer
      extended by edu.stanford.nlp.trees.OrderedCombinationTreeNormalizer
All Implemented Interfaces:
Serializable

public class OrderedCombinationTreeNormalizer
extends TreeNormalizer

This class combines multiple tree normalizers. Given a list of tree normalizer, it applies each tree normalizer from the first to the last for each of the normalize nonterminal, normalize terminal, and normalize whole tree methods.

Author:
Anna Rafferty
See Also:
Serialized Form

Constructor Summary
OrderedCombinationTreeNormalizer()
           
OrderedCombinationTreeNormalizer(List<TreeNormalizer> tns)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderedCombinationTreeNormalizer

public OrderedCombinationTreeNormalizer()

OrderedCombinationTreeNormalizer

public OrderedCombinationTreeNormalizer(List<TreeNormalizer> tns)
Method Detail

addTreeNormalizer

public 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.

Parameters:
tn -

normalizeNonterminal

public String normalizeNonterminal(String category)
Description copied from class: TreeNormalizer
Normalizes a nonterminal contents (and maybe intern it).

Overrides:
normalizeNonterminal in class TreeNormalizer
Parameters:
category - The String that decorates this nonterminal node
Returns:
The normalized form of this nonterminal String

normalizeTerminal

public String normalizeTerminal(String leaf)
Description copied from class: TreeNormalizer
Normalizes a leaf contents (and maybe intern it).

Overrides:
normalizeTerminal in class TreeNormalizer
Parameters:
leaf - The String that decorates the leaf
Returns:
The normalized form of this leaf String

normalizeWholeTree

public Tree normalizeWholeTree(Tree tree,
                               TreeFactory tf)
Description copied from class: TreeNormalizer
Normalize a whole tree -- this method assumes that the argument that it is passed is the root of a complete 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.

Overrides:
normalizeWholeTree in class TreeNormalizer
Parameters:
tree - The tree to be normalized
tf - the TreeFactory to create new nodes (if needed)
Returns:
Tree the normalized tree


Stanford NLP Group