Class: Token

Token

This class represents a token used in performing a text query. Tokens are produced by LEMTokenizers from the raw query string and consumed by a LEMParser. Each token comprises a type and text. The type is a TokenType enum instance and specifies the type of the token. The text is a string and is the texual representation of the token.

Constructor

new Token(type, text)

Constructs a token with the specified type and text
Parameters:
Name Type Description
type TokenType The type of the token
text String The texual representation of the token
Source:

Methods

getText() → {String}

Gets the texual representation of the token
Source:
Returns:
The token text
Type
String

getType() → {TokenType}

Gets the type of the token
Source:
Returns:
The token type
Type
TokenType