edu.stanford.nlp.trees
Class NegraTreeNormalizer

java.lang.Object
  extended byedu.stanford.nlp.trees.TreeNormalizer
      extended byedu.stanford.nlp.trees.NegraTreeNormalizer

public class NegraTreeNormalizer
extends TreeNormalizer

Tree normalizer for Negra. Just like BobChrisTreeNormalizer, but empty elements are differently marked.


Field Summary
protected  TreebankLanguagePack tlp
           
 
Constructor Summary
NegraTreeNormalizer()
           
NegraTreeNormalizer(TreebankLanguagePack tlp)
           
 
Method Summary
protected  String cleanUpLabel(String label)
          Remove things like hyphened functional tags and equals from the end of a node label.
 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
 

Field Detail

tlp

protected final TreebankLanguagePack tlp
Constructor Detail

NegraTreeNormalizer

public NegraTreeNormalizer()

NegraTreeNormalizer

public NegraTreeNormalizer(TreebankLanguagePack tlp)
Method Detail

normalizeTerminal

public String normalizeTerminal(String leaf)
Normalizes a leaf contents. This implementation interns the leaf.

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

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
Parameters:
category - The String that decorates this nonterminal node
Returns:
The normalized form of this nonterminal String

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 starting with '*T') from the tree. It does work for a null 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

cleanUpLabel

protected String cleanUpLabel(String label)
Remove things like hyphened functional tags and equals from the end of a node label.



Stanford NLP Group