edu.stanford.nlp.trees
Class ParametricTreeNormalizer

java.lang.Object
  |
  +--edu.stanford.nlp.trees.TreeNormalizer
        |
        +--edu.stanford.nlp.trees.ParametricTreeNormalizer

public class ParametricTreeNormalizer
extends TreeNormalizer

Normalizes trees based on parameter settings. This system can do a variety of methods of tree normalizations based on parameter settings.. The normalizations performed are: (i) terminals are interned, (ii) nonterminals are stripped of alternants, functional tags and cross-reference codes (on |, =, -) and then interned, (iii) empty elements (ones with nonterminal label "-NONE-") are deleted from the tree, (iv) the null label at the root node is replaced with the label "ROOT".
17 Apr 2001: This was fixed to work with different kinds of labels, by making proper use of the Label interface, after it was moved into the trees module.


Constructor Summary
ParametricTreeNormalizer(boolean internStrings, boolean unquoteStrings)
           
 
Method Summary
 String normalizeNonterminal(String category)
          Normalizes a nonterminal contents.
 String normalizeTerminal(String leaf)
          Normalizes a leaf contents.
 Tree normalizeWholeTree(Tree tree, TreeFactory tf)
          Normalize a whole tree -- one can assume that this is the root.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParametricTreeNormalizer

public ParametricTreeNormalizer(boolean internStrings,
                                boolean unquoteStrings)
Method Detail

normalizeTerminal

public String normalizeTerminal(String leaf)
Normalizes a leaf contents. This may do nothing or may do string interning depending on the setting of This implementation interns the leaf.

Overrides:
normalizeTerminal in class TreeNormalizer

normalizeNonterminal

public String normalizeNonterminal(String category)
Normalizes a nonterminal contents. This implementation strips functional tags, etc. and interns the nonterminal.

Overrides:
normalizeNonterminal in class TreeNormalizer

normalizeWholeTree

public Tree normalizeWholeTree(Tree tree,
                               TreeFactory tf)
Normalize a whole tree -- one can assume that this is the root. This implementation deletes empty elements (ones with nonterminal tag label '-NONE-') from the tree

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