public class DependencyNode extends TokenBasedTextSpan
SPAN_SEPARATOR
Constructor and Description |
---|
DependencyNode(AnnotationBase annBase,
int begin,
int end)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildRelation(DependencyRelation childRelation) |
void |
addHeadRelation(DependencyRelation headRelation) |
DependencyNode |
getChild(java.lang.String relationType)
Returns a child node if this dependency node has the given child dependency relation.
|
DependencyRelation |
getChildRelation(DependencyNode childNode)
Returns a child relation if this dependency node has a child relation to the given node.
|
java.util.List<DependencyRelation> |
getChildRelations() |
java.util.List<DependencyNode> |
getChildren(java.lang.String relationType)
Returns child nodes if this dependency node has the given child dependency relation.
|
DependencyNode |
getHead(java.lang.String relationType)
Returns a head node if this dependency node has the given head dependency relation.
|
DependencyRelation |
getHeadRelation(DependencyNode headNode)
Returns a head relation if this dependency node has a head relation to the given node.
|
java.util.List<DependencyRelation> |
getHeadRelations() |
java.util.List<DependencyNode> |
getHeads(java.lang.String relationType)
Returns head nodes if this dependency node has the given head dependency relation.
|
Token |
getToken()
Returns the token associated with this dependency node.
|
boolean |
hasChildRelation()
Returns true if this dependency node has a child dependency relation.
|
boolean |
hasChildRelation(DependencyNode node,
java.lang.String relationType)
Returns true if this dependency node has the given child dependency relation with the given
dependency node.
|
boolean |
hasChildRelation(java.lang.String relationType)
Returns true if this dependency node has the given child dependency relation.
|
boolean |
hasHeadRelation()
Returns true if this dependency node has a head dependency relation.
|
boolean |
hasHeadRelation(DependencyNode node,
java.lang.String relationType)
Returns true if this dependency node has the given head dependency relation with the given
dependency node.
|
boolean |
hasHeadRelation(java.lang.String relationType)
Returns true if this dependency node has the given head dependency relation.
|
boolean |
isAncestor(DependencyNode node)
Returns true if this node is an ancestor of the given node.
|
boolean |
isRoot() |
void |
setChildRelations(java.util.List<DependencyRelation> childRelations) |
void |
setHeadRelations(java.util.List<DependencyRelation> headRelations) |
void |
setRoot(boolean isRoot) |
void |
setToken(Token token)
Sets the associated token to this dependency node.
|
addToken, addTokens, equals, findAssociatedTokens, findHeadWordFromDependency, findTokens, getContextTokens, getFirstToken, getHeadWord, getLastToken, getSentence, getTokenAt, getTokens, hashCode, isValidToken, numTokens, setFirstToken, setHeadWord, setTokens
addSpan, compareTo, cover, coveredBy, coveredBy, coveredByOneOf, coverOneOf, findAnnotationCoveredByOneOf, findAnnotationCoveringOneOf, follows, getBegin, getEnd, getLowerCaseText, getLowerCaseTexts, getSpans, getText, getTexts, hasMultipleSpans, hasSameSpan, hasSameSpanAsOneOf, numSpans, overlap, precedes, toString
addToBase, getAnnotationBase, getAnnotatorId, getId, getSourceDocument, getTypeName, removeFromBase, setAnnotatorId, setId
public DependencyNode(AnnotationBase annBase, int begin, int end)
annBase
- begin
- end
- public boolean isAncestor(DependencyNode node)
node
- public boolean isRoot()
public void setRoot(boolean isRoot)
public java.util.List<DependencyRelation> getHeadRelations()
public void setHeadRelations(java.util.List<DependencyRelation> headRelations)
public void addHeadRelation(DependencyRelation headRelation)
public DependencyRelation getHeadRelation(DependencyNode headNode)
headNode
- public DependencyNode getHead(java.lang.String relationType)
relationType
- public java.util.List<DependencyNode> getHeads(java.lang.String relationType)
relationType
- public boolean hasHeadRelation()
public boolean hasHeadRelation(java.lang.String relationType)
relationType
- public boolean hasHeadRelation(DependencyNode node, java.lang.String relationType)
node
- relationType
- public java.util.List<DependencyRelation> getChildRelations()
public void setChildRelations(java.util.List<DependencyRelation> childRelations)
public void addChildRelation(DependencyRelation childRelation)
public DependencyRelation getChildRelation(DependencyNode childNode)
childNode
- public DependencyNode getChild(java.lang.String relationType)
relationType
- public java.util.List<DependencyNode> getChildren(java.lang.String relationType)
relationType
- public boolean hasChildRelation()
public boolean hasChildRelation(java.lang.String relationType)
relationType
- public boolean hasChildRelation(DependencyNode node, java.lang.String relationType)
node
- relationType
- public Token getToken()
public void setToken(Token token)
token
-