pre_tokenize_text(text, {
        section_index = undefined,
    } = {}) {

        let normalized = text.replaceAll(' ', this.strRep);

        if (
            // We add a prefix space if:
            //  (1) The addPrefixSpace option is enabled and the normalized
            //      token does not already start with the replacement character.
            (this.addPrefixSpace && !normalized.startsWith(this.replacement))

            // and (2) either:
            //  (a) prepend_scheme is 'always'
            //  (b) prepend_scheme is 'first' and this is the first section
            && (
                this.prepend_scheme === 'always' ||
                (this.prepend_scheme === 'first' && section_index === 0)
            )
        ) {
            normalized = this.strRep + normalized;
        }
        return [normalized];
    }
This method takes a string, replaces spaces with the replacement character,
adds a prefix space if requested, and returns a new list of tokens.
@param {string} text The text to pre-tokenize.
@param {Object} [options] The options for the pre-tokenization.
@param {number} [options.section_index] The index of the section to pre-tokenize.
@returns {string[]} A new list of pre-tokenized tokens.