public abstract class HeadFinderBase extends Object
This file is based on the similar file from the Stanford NLP code, rewritten to talk nicely to the other parts of this package.
| Modifier and Type | Class and Description |
|---|---|
static class |
HeadFinderBase.HeadSearchDirection |
| Modifier and Type | Field and Description |
|---|---|
protected Pair<HeadFinderBase.HeadSearchDirection,String[]> |
defaultRule |
| Constructor and Description |
|---|
HeadFinderBase() |
| Modifier and Type | Method and Description |
|---|---|
protected Constituent |
findHead(Constituent parseNode) |
protected int |
fixHeadChildHacks(int headChildId,
Constituent node) |
protected static String |
getChildLabel(Constituent tree,
int headCandidate) |
Constituent |
getHeadChild(Constituent parseNode)
Get the head node of a constituent belonging to a parse tree.
|
Constituent |
getHeadWord(Constituent tree) |
int |
getHeadWordPosition(Constituent subTree) |
abstract List<Pair<HeadFinderBase.HeadSearchDirection,String[]>> |
getNonterminalHeadInformation(String nonTerminal)
Return information about how the head is to be computed, given the non-terminal.
|
protected Constituent |
getPredefinedHead(Constituent treeNode) |
protected Pair<HeadFinderBase.HeadSearchDirection,String[]> defaultRule
protected static String getChildLabel(Constituent tree, int headCandidate)
public Constituent getHeadChild(Constituent parseNode)
parseNode - A node from the parse tree viewpublic Constituent getHeadWord(Constituent tree)
public int getHeadWordPosition(Constituent subTree)
protected Constituent getPredefinedHead(Constituent treeNode)
protected Constituent findHead(Constituent parseNode)
protected int fixHeadChildHacks(int headChildId,
Constituent node)
public abstract List<Pair<HeadFinderBase.HeadSearchDirection,String[]>> getNonterminalHeadInformation(String nonTerminal)
NOTE: If no rule is specified, return null.
Copyright © 2017. All rights reserved.