|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectse.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 Objectpublic Pair<Integer,Integer> span()
Node
span in class Nodepublic boolean isSameOrAncestorOf(Node n)
Noden.
isSameOrAncestorOf in class Noden - the node.
n.public TokenNode depParent()
public String getLabel()
Node
getLabel in class Nodepublic TokenNode getHead()
Node
getHead in class Nodepublic TokenNode getLastToken()
Node
getLastToken in class Nodepublic TokenNode getFirstToken()
Node
getFirstToken in class Nodepublic boolean isPunctuation()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||