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) |
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, getConstituentsCoveringSpan, getConstituentsCoveringToken, getConstituentsCoveringTokens, getEndSpan, getFilteredConstituents, getLabelsCovering, getLabelsCoveringSpan, getLabelsCoveringToken, getLabelsCoveringTokens, getNumberOfConstituents, getRelations, getRestrictedView, getScore, getStartSpan, getTextAnnotation, getViewCoveringSpan, getViewCoveringToken, getViewCoveringTokens, getViewGenerator, getViewName, iterator, orderBy, select, unique, where
public TokenLabelView(String viewName, String viewGenerator, TextAnnotation text, double score)
id
- viewName
- text
- score
- public Constituent addTokenLabel(int tokenId, String label, double score)
tokenId
- label
- score
- SpanLabelView#addSpanLabel(int, int, String, double)}
public void addTokenAttribute(int tokenId, String attributeKey, String attributeValue) throws EdisonException
EdisonException
public Constituent getConstituentAtToken(int tokenId)
public String toString()
toString
in class SpanLabelView
Copyright © 2015. All rights reserved.