public class SemanticHeadFinder extends ModCollinsHeadFinder
By default the SemanticHeadFinder uses a treatment of copula where the complement of the copula is taken as the head. That is, a sentence like "Bill is big" will be analyzed as:
This analysis is used for questions and declaratives for adjective complements and declarative nominal complements. However Wh-sentences with nominal complements do not receive this treatment. "Who is the president?" is analyzed with "the president" as nsubj and "who" as "attr" of the copula:
(Such nominal copula sentences are complex: arguably, depending on the circumstances, several analyses are possible, with either the overt NP able to be any of the subject, the predicate, or one of two referential entities connected by an equational copula. These uses aren't differentiated.)
Existential sentences are treated as follows:
"There is a man"
defaultLeftRule, defaultRightRule, defaultRule, nonTerminalInfo, tlp
|Constructor and Description|
Create a SemanticHeadFinder.
|Modifier and Type||Method and Description|
Determine which daughter of the current parse tree is the head.
Returns true if this tree is a preterminal that is a verbal auxiliary.
Generally will be false, except for SemanticHeadFinder
Overwrite the postOperationFix method.
determineHead, determineHead, findMarkedHead, traverseLocate
public SemanticHeadFinder(boolean noCopulaHead)
public SemanticHeadFinder(TreebankLanguagePack tlp, boolean noCopulaHead)
tlp- The TreebankLanguagePack, used by the superclass to get basic category of constituents.
noCopulaHead- If true, a copular verb (a form of be) is not treated as head when it has an AdjP or NP complement. If false, a copula verb is still always treated as a head. But it will still be treated as an auxiliary in periphrastic tenses with a VP complement.
public boolean makesCopulaHead()
protected int postOperationFix(int headIdx, Tree daughterTrees)
headIdx- The index of the proposed head
daughterTrees- The array of daughter trees
protected Tree determineNonTrivialHead(Tree t, Tree parent)
t- The parse tree to examine the daughters of. This is assumed to never be a leaf
parent- The parent of t (or may be null)
public boolean isVerbalAuxiliary(Tree t)
t- A tree to examine for being an auxiliary.
Stanford NLP Group