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. It assumes that the daughters already have had their heads determined. Another method has to do the tree walking.

Specified by:
determineHead in interface HeadFinder
Parameters:
t - The parse tree to examine the daughters of
Returns:
The parse tree that is the head. The convention has been that this returns null if no head is found. But maybe it should throw an exception?

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. It assumes that the daughters already have had their heads determined. Another method has to do the tree walking.

Specified by:
determineHead in interface HeadFinder
Parameters:
t - The parse tree to examine the daughters of
parent - The parent of tree t
Returns:
The parse tree that is the head. The convention has been that this returns null if no head is found. But maybe it should throw an exception?


Stanford NLP Group