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 Constituents that are one token long and does not have any
Relations. 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, getSpanLabelsaddRelation, 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, whereclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic 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
Exceptionpublic Constituent getConstituentAtToken(int tokenId)
public String toString()
toString in class SpanLabelViewCopyright © 2017. All rights reserved.