|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.HeadTreeNode
public class HeadTreeNode
Provides a convenient data structure for navigating a parse tree in which heads have been found and percolated up through the tree. This data structure mirrors the head relations of this parser, where the underlying lexicalized grammar productions are of the form
P → LnLn-1 … H … Rn-1RnSince the order of the modifying nonterminals is from adjacent to the head outward, this data structure stores modifying nonterminals in this order.
Constructor Summary | |
---|---|
HeadTreeNode(Sexp tree)
Constructs a new instance from the specified parse tree. |
Method Summary | |
---|---|
boolean |
containsVerb()
Indicates whether this subtree contains a verb. |
protected Symbol |
getHeadWordLabel()
|
HeadTreeNode |
headChild()
Gets the head child of this node. |
Word |
headWord()
Gets the head word for this node. |
int |
headWordIdx()
Gets the index of the head word for this node. |
boolean |
isPreterminal()
Returns whether this node represents a preterminal. |
Symbol |
label()
Gets the nonterminal label for this node. |
int |
leftIdx()
Gets the index of the leftmost word in this subtree. |
static void |
main(String[] args)
|
Symbol |
originalHeadWord()
Gets the original version of the head word. |
List |
postMods()
Gets the list of postmodifiers of the head child of this node. |
List |
preMods()
Gets the list of premodifiers of the head child of this node. |
int |
rightIdx()
Gets the index of the rightmost word in this subtree plus 1. |
void |
setOriginalHeadWord(Symbol originalHeadWord)
Sets the original version of the head word of this node, before any downcasing or other transformations were applied during training. |
Sexp |
toSexp()
Converts this object to an S-expression. |
Sexp |
toSexp(boolean addHeadWords)
|
String |
toString()
Returns a string representation of the tree rooted at this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HeadTreeNode(Sexp tree)
tree
- the parse tree from which to construct a new
HeadTreeNode
Method Detail |
---|
public boolean isPreterminal()
public Symbol label()
public Word headWord()
public int headWordIdx()
public Symbol originalHeadWord()
public boolean containsVerb()
public HeadTreeNode headChild()
public List preMods()
public List postMods()
public int leftIdx()
public int rightIdx()
public void setOriginalHeadWord(Symbol originalHeadWord)
originalHeadWord
- the original head word to set for this nodepublic Sexp toSexp()
SexpConvertible
toSexp
in interface SexpConvertible
public Sexp toSexp(boolean addHeadWords)
protected Symbol getHeadWordLabel()
public String toString()
toString
in class Object
public static void main(String[] args)
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |