public interface Vocabulary
Vocabulary is a collection of tokens. The primary purpose of a vocabulary is the map a
token to an index.| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String token)
Check if the vocabulary contains a token.
|
long |
getIndex(java.lang.String token)
Returns the index of the given token.
|
java.lang.String |
getToken(long index)
Returns the token corresponding to the given index.
|
long |
size()
Returns the size of the
Vocabulary. |
java.lang.String getToken(long index)
index - the indexboolean contains(java.lang.String token)
token - String token to be checkedlong getIndex(java.lang.String token)
token - the tokenlong size()
Vocabulary.Vocabulary