Tokenizer is used to tokenize items such as text, number and so on. It also includes a number of useful functions for converting between tokens and items.
Creates a new tokenizer object.
Tokenizer.new(tokenizedItemArray: []): TokenizerObject
Adds an item to be tokenized. If the item already exists, then it will ignore the item.
Tokenizer:addItem(item: any)
Tokenize all items in the item array. If an item already exists, then it will ignore that item.
Tokenizer:addAllItems(itemArray: [])
Gets the item from a given token number. If no item is found from the given token number, then it will return nil.
Tokenizer:convertTokenToItem(tokenNumber: integer): any
Gets the token number from a given item. If no item is found, then it will return nil.
Tokenizer:convertItemToToken(item: any): integer
Gets an array of tokenized items from the tokenizer object.
Tokenizer:getTokenizedItemArray(): []
Sets an array of tokenized items to the tokenizer object.
Tokenizer:setTokenizedItemArray(tokenizedItemArray: [])