public class TokenLabelView extends SpanLabelView
SpanLabelView
, where the
length of a labeled span is one. In terms of the constituents and relations view, this means that
the TokenLabelView has Constituent
s that are one token long and does not have any
Relation
s. This class provides methods to add and get labels for a single token.
This class is best suited for views like Part-of-speech, lemma, etc.
constituents, endSpan, relations, score, startSpan, textAnnotation, tokensToConstituents, viewGenerator, viewName
Constructor and Description |
---|
TokenLabelView(String viewName,
String viewGenerator,
TextAnnotation text,
double score) |
TokenLabelView(String viewName,
TextAnnotation text)
Create a new TokenLabelView with default
View.viewGenerator and View.score . |
Modifier and Type | Method and Description |
---|---|
void |
addTokenAttribute(int tokenId,
String attributeKey,
String attributeValue) |
Constituent |
addTokenLabel(int tokenId,
String label,
double score)
Adds a label to a token and returns the newly created constituent.
|
Constituent |
getConstituentAtToken(int tokenId) |
String |
getTokenAttribute(int tokenId,
String key) |
String |
toString() |
addConstituent, addSpanLabel, getLabel, getSpanLabels
addRelation, containsConstituent, count, getConstituents, getConstituentsCovering, getConstituentsCoveringCharSpan, getConstituentsCoveringSpan, getConstituentsCoveringToken, getConstituentsCoveringTokens, getConstituentsOverlappingCharSpan, getConstituentsWithSpan, getEndSpan, getFilteredConstituents, getLabelsCovering, getLabelsCoveringSpan, getLabelsCoveringToken, getLabelsCoveringTokens, getNumberOfConstituents, getRelations, getRestrictedView, getScore, getStartSpan, getTextAnnotation, getViewCoveringSpan, getViewCoveringToken, getViewCoveringTokens, getViewGenerator, getViewName, iterator, orderBy, removeAllConsituents, removeAllRelations, removeAttributes, removeConstituent, removeRelation, select, unique, where
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public TokenLabelView(String viewName, TextAnnotation text)
View.viewGenerator
and View.score
.public TokenLabelView(String viewName, String viewGenerator, TextAnnotation text, double score)
public Constituent addTokenLabel(int tokenId, String label, double score)
public void addTokenAttribute(int tokenId, String attributeKey, String attributeValue) throws Exception
Exception
public Constituent getConstituentAtToken(int tokenId)
public String toString()
toString
in class SpanLabelView
Copyright © 2017. All rights reserved.