Package org.tribuo.util.tokens
Class Token
java.lang.Object
org.tribuo.util.tokens.Token
A single token extracted from a String.
Tokens are immutable, and may be records one day.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Tokenizers may product multiple kinds of tokens, depending on the application to which they're being put. -
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs a token.Token
(String text, int start, int end, Token.TokenType type) Constructs a token. -
Method Summary
-
Field Details
-
text
The token text. -
start
public final int startThe start index. -
end
public final int endThe end index. -
type
The token type.
-
-
Constructor Details
-
Token
Constructs a token.- Parameters:
text
- should be equivalent to the substring of the original tokenized text for the given character offsets start and endstart
- the starting offset of the tokenend
- the ending offset of the token (exclusive or inclusive?)
-
Token
Constructs a token.- Parameters:
text
- should be equivalent to the substring of the original tokenized text for the given character offsets start and endstart
- the starting offset of the tokenend
- the ending offset of the token (exclusive or inclusive?)type
- the type of the token
-
-
Method Details