edu.stanford.nlp.trees
Class ChelbaHeadFinder
java.lang.Object
|
+--edu.stanford.nlp.trees.ChelbaHeadFinder
- All Implemented Interfaces:
- HeadFinder
- public class ChelbaHeadFinder
- extends Object
- implements HeadFinder
Implements the HeadFinder found in Ciprian Chelba's 2000 thesis.
These rules are suitable for the Penn Treebank.
This code assumes that tree category labels are interned and
does comparisons with equality (==). It won't work if the category labels
are not interned. In particular, this also means that functional tags
should have been stripped.
Method Summary |
Tree |
determineHead(Tree t)
Determine which daughter of the current parse tree is the head. |
static void |
main(String[] args)
Go through trees and determine their heads and print them. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChelbaHeadFinder
public ChelbaHeadFinder()
determineHead
public Tree determineHead(Tree t)
- Determine which daughter of the current parse tree is the head.
It assumes that the daughters alread have had their heads
determined. It assumes that category Strings were interned.
It assumes that labels are a
CategoryWordTag
- Specified by:
determineHead
in interface HeadFinder
- Parameters:
t
- The parse tree to examine the daughters of
- Returns:
- The parse tree that is the head
main
public static void main(String[] args)
- Go through trees and determine their heads and print them.
Just for debuggin'
Use: java ChelbaHeadFinder /wsj/07
Stanford NLP Group