edu.stanford.nlp.trees
Class LeftHeadFinder

java.lang.Object
  extended by edu.stanford.nlp.trees.LeftHeadFinder
All Implemented Interfaces:
HeadFinder, java.io.Serializable

public class LeftHeadFinder
extends java.lang.Object
implements HeadFinder

HeadFinder that always returns the leftmost daughter as head. For testing purposes.

Author:
Roger Levy
See Also:
Serialized Form

Constructor Summary
LeftHeadFinder()
           
 
Method Summary
 Tree determineHead(Tree t)
          Determine which daughter of the current parse tree is the head.
 Tree determineHead(Tree t, Tree parent)
          Determine which daughter of the current parse tree is the head given the parent of the tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeftHeadFinder

public LeftHeadFinder()
Method Detail

determineHead

public Tree determineHead(Tree t)
Description copied from interface: HeadFinder
Determine which daughter of the current parse tree is the head.

Specified by:
determineHead in interface HeadFinder
Parameters:
t - The parse tree to examine the daughters of
Returns:
The daughter tree that is the head. This will always be non-null. An Exception will be thrown if no head can be determined.

determineHead

public Tree determineHead(Tree t,
                          Tree parent)
Description copied from interface: HeadFinder
Determine which daughter of the current parse tree is the head given the parent of the tree.

Specified by:
determineHead in interface HeadFinder
Parameters:
t - The parse tree to examine the daughters of
parent - The parent of tree t
Returns:
The daughter tree that is the head. This will always be non-null. An Exception will be thrown if no head can be determined.


Stanford NLP Group