Skip to content

Class: SpecialToken

Defined in: utils/LlamaText.ts:519

Constructors

new SpecialToken()

ts
new SpecialToken(value: BuiltinSpecialTokenValue): SpecialToken

Defined in: utils/LlamaText.ts:522

Parameters

ParameterType
valueBuiltinSpecialTokenValue

Returns

SpecialToken

Properties

value

ts
readonly value: BuiltinSpecialTokenValue;

Defined in: utils/LlamaText.ts:520

Methods

toString()

ts
toString(): BuiltinSpecialTokenValue

Defined in: utils/LlamaText.ts:526

Returns

BuiltinSpecialTokenValue


tokenize()

ts
tokenize(tokenizer: Tokenizer): Token[]

Defined in: utils/LlamaText.ts:530

Parameters

ParameterType
tokenizerTokenizer

Returns

Token[]


toJSON()

ts
toJSON(): LlamaTextSpecialTokenJSON

Defined in: utils/LlamaText.ts:534

Returns

LlamaTextSpecialTokenJSON


fromJSON()

ts
static fromJSON(json: LlamaTextSpecialTokenJSON): SpecialToken

Defined in: utils/LlamaText.ts:558

Parameters

ParameterType
jsonLlamaTextSpecialTokenJSON

Returns

SpecialToken


isSpecialTokenJSON()

ts
static isSpecialTokenJSON(value: LlamaTextJSONValue): value is LlamaTextSpecialTokenJSON

Defined in: utils/LlamaText.ts:565

Parameters

ParameterType
valueLlamaTextJSONValue

Returns

value is LlamaTextSpecialTokenJSON


getTokenToValueMap()

ts
static getTokenToValueMap(tokenizer: Tokenizer): ReadonlyMap<undefined | Token, BuiltinSpecialTokenValue>

Defined in: utils/LlamaText.ts:569

Parameters

ParameterType
tokenizerTokenizer

Returns

ReadonlyMap<undefined | Token, BuiltinSpecialTokenValue>