public class ParseTreeNode extends Edge
| Modifier and Type | Field and Description |
|---|---|
Annotation |
ann
for leaf nodes, the (token or constit) annotation matched by this node.
|
String |
function
function tag.
|
int |
head
for non-leaf nodes, the number of the child (starting at 1) which is the
head of this node.
|
String |
word
for leaf nodes, the word matched by this node.
|
| Constructor and Description |
|---|
ParseTreeNode(Object category,
ParseTreeNode[] children,
int start,
int end,
Annotation ann,
String word)
create a ParseTreeNode corresponding to a leaf of the parse tree.
|
ParseTreeNode(Object category,
ParseTreeNode[] children,
int start,
int end,
Annotation ann,
String word,
String function)
create a ParseTreeNode corresponding to a leaf of the parse tree.
|
ParseTreeNode(Object category,
ParseTreeNode[] children,
int start,
int end,
int head)
create a ParseTreeNode corresponding to an internal node of the parse
tree.
|
ParseTreeNode(Object category,
ParseTreeNode[] children,
int start,
int end,
int head,
String function)
create a ParseTreeNode corresponding to an internal node of the parse
tree.
|
| Modifier and Type | Method and Description |
|---|---|
static Annotation[] |
children(Annotation node)
given a parse tree Annotation 'node', as created by makeParseAnnotations,
returns an array containing the children of 'node', or null if the node
has no children.
|
static Annotation |
makeParseAnnotations(Document doc,
ParseTreeNode n)
given a parse tree in the form of nested ParseTreeNodes, adds an
Annotation of type 'constit' to Document 'doc' for each non-terminal node
in the tree.
|
void |
printTree()
prints the parse tree rooted at this node in an indented form.
|
static void |
terminalToToken(Document doc,
ParseTreeNode node) |
String |
toString()
return a String representation of the ParseTreeNode.
|
getChildrenpublic Annotation ann
public String word
public int head
public String function
public ParseTreeNode(Object category, ParseTreeNode[] children, int start, int end, Annotation ann, String word)
public ParseTreeNode(Object category, ParseTreeNode[] children, int start, int end, Annotation ann, String word, String function)
public ParseTreeNode(Object category, ParseTreeNode[] children, int start, int end, int head)
public ParseTreeNode(Object category, ParseTreeNode[] children, int start, int end, int head, String function)
public String toString()
public void printTree()
public static Annotation makeParseAnnotations(Document doc, ParseTreeNode n)
public static Annotation[] children(Annotation node)
node - an Annotation representing a parse tree node (an Annotation of
type 'constit').public static void terminalToToken(Document doc, ParseTreeNode node)
Copyright © 2016 New York University. All rights reserved.