Documentation - v1.5.3
    Preparing search index...

    Class defaultAbstract

    Tokenizer Class

    This class provides methods for tokenizing text into spans of tokens.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    regex: RegExp = ...

    The regular expression used for tokenization.

    Methods

    • Tokenize a given text into spans of tokens.

      Parameters

      • text: string

        The text to be tokenized.

      Returns TokenizerSpans[]

      An array of spans representing the tokens in the text.

      This method tokenizes the text and returns an array of spans, each containing the start index, end index, and the token itself.

    • Tokenize a given text into an array of tokens.

      Parameters

      • text: string

        The text to be tokenized.

      Returns string[]

      An array of tokens extracted from the text.

      This method uses a regular expression to split the text into tokens based on the defined regex.