Class: SpecialToken
Defined in: utils/LlamaText.ts:519
Constructors
new SpecialToken()
ts
new SpecialToken(value: BuiltinSpecialTokenValue): SpecialToken
Defined in: utils/LlamaText.ts:522
Parameters
Parameter | Type |
---|---|
value | BuiltinSpecialTokenValue |
Returns
Properties
value
ts
readonly value: BuiltinSpecialTokenValue;
Defined in: utils/LlamaText.ts:520
Methods
toString()
ts
toString(): BuiltinSpecialTokenValue
Defined in: utils/LlamaText.ts:526
Returns
tokenize()
ts
tokenize(tokenizer: Tokenizer): Token[]
Defined in: utils/LlamaText.ts:530
Parameters
Parameter | Type |
---|---|
tokenizer | Tokenizer |
Returns
Token
[]
toJSON()
ts
toJSON(): LlamaTextSpecialTokenJSON
Defined in: utils/LlamaText.ts:534
Returns
fromJSON()
ts
static fromJSON(json: LlamaTextSpecialTokenJSON): SpecialToken
Defined in: utils/LlamaText.ts:558
Parameters
Parameter | Type |
---|---|
json | LlamaTextSpecialTokenJSON |
Returns
isSpecialTokenJSON()
ts
static isSpecialTokenJSON(value: LlamaTextJSONValue): value is LlamaTextSpecialTokenJSON
Defined in: utils/LlamaText.ts:565
Parameters
Parameter | Type |
---|---|
value | LlamaTextJSONValue |
Returns
value is LlamaTextSpecialTokenJSON
getTokenToValueMap()
ts
static getTokenToValueMap(tokenizer: Tokenizer): ReadonlyMap<undefined | Token, BuiltinSpecialTokenValue>
Defined in: utils/LlamaText.ts:569
Parameters
Parameter | Type |
---|---|
tokenizer | Tokenizer |
Returns
ReadonlyMap
<undefined
| Token
, BuiltinSpecialTokenValue
>