E - Type of tokens in the tagging.public class Tagging<E> extends Object
Tagging<E> represents a first-best assignment of a sequence
of tags to a sequence of tokens of type E.| Constructor and Description |
|---|
Tagging(List<E> tokens,
List<String> tags)
Construct a tagging with the specified list of tokens and tags.
|
| Modifier and Type | Method and Description |
|---|---|
int |
size()
Returns the number of tokens and tags in this
tagging.
|
String |
tag(int n)
Return the tag in the specified position for this
tagging.
|
List<String> |
tags()
Return an immutable list of tags for this tagging.
|
E |
token(int n)
Return the token in the specified position for this
tagging.
|
List<E> |
tokens()
Return an immutable view of the tokens for this tagging.
|
String |
toString()
Return a string-based representation of this tagging.
|
public Tagging(List<E> tokens, List<String> tags)
tokens - List of tokens for the tagging.tags - List of tags for the tagging.IllegalArgumentException - If the lists are not of the
same size.public int size()
public E token(int n)
n - Position of token.IndexOutOfBoundsException - If the position is out of
range (n < 0 || n >= size()).public String tag(int n)
n - Position of tag.IndexOutOfBoundsException - If the position is out of
range (n < 0 || n >= size()).public List<E> tokens()
Copyright © 2016 Alias-i, Inc.. All rights reserved.