Skip to content

Class: SpecialToken

Constructors

new SpecialToken()

ts
new SpecialToken(value: BuiltinSpecialTokenValue): SpecialToken

Parameters

ParameterType
valueBuiltinSpecialTokenValue

Returns

SpecialToken

Defined in

utils/LlamaText.ts:519

Properties

value

ts
readonly value: BuiltinSpecialTokenValue;

Defined in

utils/LlamaText.ts:517

Methods

toString()

ts
toString(): BuiltinSpecialTokenValue

Returns

BuiltinSpecialTokenValue

Defined in

utils/LlamaText.ts:523


tokenize()

ts
tokenize(tokenizer: Tokenizer): Token[]

Parameters

ParameterType
tokenizerTokenizer

Returns

Token[]

Defined in

utils/LlamaText.ts:527


toJSON()

ts
toJSON(): LlamaTextSpecialTokenJSON

Returns

LlamaTextSpecialTokenJSON

Defined in

utils/LlamaText.ts:531


fromJSON()

ts
static fromJSON(json: LlamaTextSpecialTokenJSON): SpecialToken

Parameters

ParameterType
jsonLlamaTextSpecialTokenJSON

Returns

SpecialToken

Defined in

utils/LlamaText.ts:555


isSpecialTokenJSON()

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

Parameters

ParameterType
valueLlamaTextJSONValue

Returns

value is LlamaTextSpecialTokenJSON

Defined in

utils/LlamaText.ts:562


getTokenToValueMap()

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

Parameters

ParameterType
tokenizerTokenizer

Returns

ReadonlyMap<undefined | Token, BuiltinSpecialTokenValue>

Defined in

utils/LlamaText.ts:566