edu.stanford.nlp.trees
Interface HeadFinder

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractCollinsHeadFinder, ArabicHeadFinder, BikelChineseHeadFinder, ChineseHeadFinder, ChineseSemanticHeadFinder, CollinsHeadFinder, DybroFrenchHeadFinder, FrenchHeadFinder, LeftHeadFinder, ModCollinsHeadFinder, NegraHeadFinder, SemanticHeadFinder, SunJurafskyChineseHeadFinder, TueBaDZHeadFinder

public interface HeadFinder
extends java.io.Serializable

An interface for finding the "head" daughter of a phrase structure tree. This could potentially be any sense of "head", but has mainly been used to find the lexical head for lexicalized PCFG parsing.

Author:
Christopher Manning

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.
 

Method Detail

determineHead

Tree determineHead(Tree t)
Determine which daughter of the current parse tree is the head.

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.
Throws:
java.lang.IllegalStateException - If a subclass has missing or badly formatted head rule data
java.lang.IllegalArgumentException - If the argument Tree has unexpected phrasal categories in it (and the implementation doesn't just use some heuristic to always determine some head).

determineHead

Tree determineHead(Tree t,
                   Tree parent)
Determine which daughter of the current parse tree is the head given the parent of the tree.

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