|
|||||||||
| 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
public abstract class Node
A node in a phrase structure tree. Is either a TokenNode or a NonterminalNode.
| Field Summary | |
|---|---|
NonterminalNode |
parent
Parent node. |
| Constructor Summary | |
|---|---|
Node()
|
|
| Method Summary | |
|---|---|
abstract TokenNode |
getFirstToken()
Returns the leftmost dependent token. |
abstract TokenNode |
getHead()
Returns the head token node. |
abstract String |
getLabel()
For a token node, returns the part of speech; for a nonterminal node, returns its label. |
abstract TokenNode |
getLastToken()
Returns the rightmost dependent token. |
abstract boolean |
isSameOrAncestorOf(Node n)
Returns true if this node is identical to or is an ancestor of n. |
boolean |
overlaps(Node n2)
Returns true if the spans of the nodes overlap. |
(package private) void |
setHeads()
|
(package private) void |
setHeadsSwedish()
|
abstract 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public NonterminalNode parent
| Constructor Detail |
|---|
public Node()
| Method Detail |
|---|
public abstract Pair<Integer,Integer> span()
public abstract boolean isSameOrAncestorOf(Node n)
n.
n - the node.
n.public abstract String getLabel()
public abstract TokenNode getHead()
public abstract TokenNode getLastToken()
public abstract TokenNode getFirstToken()
public boolean overlaps(Node n2)
n2 - the other node.
void setHeads()
void setHeadsSwedish()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||