|
|||||||||
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.TokenNode
public class TokenNode
A terminal node in a phrase structure tree.
Field Summary | |
---|---|
String |
lemma
The lemma, if available. |
String |
pos
The part of speech. |
int |
position
The position in the sentence. |
(package private) Node |
subtree
|
String |
word
The word. |
Fields inherited from class se.lth.cs.nlp.nlputils.pstree.Node |
---|
parent |
Constructor Summary | |
---|---|
TokenNode()
|
Method Summary | |
---|---|
TokenNode |
depParent()
The dependency parent of this token node. |
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 |
isPunctuation()
Returns true if this is a punctuation token. |
boolean |
isSameOrAncestorOf(Node n)
Returns true if this node is identical to or is an ancestor of n . |
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, setHeads, setHeadsSwedish |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String word
public String pos
public String lemma
public int position
Node subtree
Constructor Detail |
---|
public TokenNode()
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 depParent()
public String getLabel()
Node
getLabel
in class Node
public TokenNode getHead()
Node
getHead
in class Node
public TokenNode getLastToken()
Node
getLastToken
in class Node
public TokenNode getFirstToken()
Node
getFirstToken
in class Node
public boolean isPunctuation()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |