getIndexForString(string) {
        // If the string is found in the cache, return the index.
        const key = _.isArray(string) ? JSON.stringify(string) : string;
        let index = this._indexMap[key];
        if (index >= 0) return index;

        // Otherwise, add it to the caches.
        index = this._stringArray.length;
        this._stringArray.push(string);
        this._indexMap[key] = index;

        // Append a new si node.
        this._node.children.push({
            name: "si",
            children: _.isArray(string) ? string : [
                {
                    name: "t",
                    attributes: { 'xml:space': "preserve" },
                    children: [string]
                }
            ]
        });

        return index;
    }
Gets the index for a string
@param {string|Array.<{}>} string - The string or rich text array.
@returns {number} The index