edu.stanford.nlp.trees.international.tuebadz
Class TueBaDZPennTreeNormalizer

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

public class TueBaDZPennTreeNormalizer
extends TreeNormalizer

Tree normalizer for the TueBaDZ treebank. (An adaptation of Roger Levy's NegraPennTreeNormalizer.)

Author:
Wolfgang Maier (wmaier@sfs.uni-tuebingen.de)
See Also:
Serialized Form

Field Summary
protected  TreebankLanguagePack tlp
           
 
Constructor Summary
TueBaDZPennTreeNormalizer()
           
TueBaDZPennTreeNormalizer(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 nonUnaryRootSymbol()
           
 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.
 String rootSymbol()
           
 
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

TueBaDZPennTreeNormalizer

public TueBaDZPennTreeNormalizer()

TueBaDZPennTreeNormalizer

public TueBaDZPennTreeNormalizer(TreebankLanguagePack tlp)
Method Detail

rootSymbol

public String rootSymbol()

nonUnaryRootSymbol

public String nonUnaryRootSymbol()

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

cleanUpLabel

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


normalizeWholeTree

public Tree normalizeWholeTree(Tree tree,
                               TreeFactory tf)
Normalize a whole tree. TueBa-D/Z adaptation. Fixes trees with non-unary roots, does nothing else.

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