|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object se.lth.cs.nlp.nlputils.pstree.Node se.lth.cs.nlp.nlputils.pstree.NonterminalNode
public class NonterminalNode
Non-terminal node in a phrase structure tree.
Field Summary | |
---|---|
ArrayList<Node> |
children
The children of the node. |
TokenNode |
head
The head token node. |
Node |
headChild
The child that contains the head. |
String |
label
The label of the node. |
(package private) String |
secondLabel
|
(package private) String |
tmpHeadToken
|
Fields inherited from class se.lth.cs.nlp.nlputils.pstree.Node |
---|
parent |
Constructor Summary | |
---|---|
NonterminalNode()
|
Method Summary | |
---|---|
TokenNode |
getFirstToken()
Returns the leftmost dependent token. |
TokenNode |
getHead()
Returns the head token node. |
String |
getLabel()
For a token node, returns the part of speech; for a nonterminal node, returns its label. |
TokenNode |
getLastToken()
Returns the rightmost dependent token. |
boolean |
isSameOrAncestorOf(Node n)
Returns true if this node is identical to or is an ancestor of n . |
(package private) void |
setHeads()
Uses the head rules described in Collins' thesis to find the heads of the nodes. |
(package private) void |
setHeadsSwedish()
|
Pair<Integer,Integer> |
span()
Returns the span of the node, that is the index of the leftmost dependent token and the index of the rightmost dependent token + 1. |
String |
toString()
|
Methods inherited from class se.lth.cs.nlp.nlputils.pstree.Node |
---|
overlaps |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String label
public TokenNode head
public ArrayList<Node> children
public Node headChild
String tmpHeadToken
String secondLabel
Constructor Detail |
---|
public NonterminalNode()
Method Detail |
---|
public String toString()
toString
in class Object
public Pair<Integer,Integer> span()
Node
span
in class Node
public boolean isSameOrAncestorOf(Node n)
Node
n
.
isSameOrAncestorOf
in class Node
n
- the node.
n
.public TokenNode getLastToken()
Node
getLastToken
in class Node
public TokenNode getFirstToken()
Node
getFirstToken
in class Node
public String getLabel()
Node
getLabel
in class Node
public TokenNode getHead()
Node
getHead
in class Node
void setHeads()
setHeads
in class Node
void setHeadsSwedish()
setHeadsSwedish
in class Node
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |