textToIndices(text) {
    const indices = [];
    for (let i = 0; i < text.length; ++i) {
      indices.push(this.charSet_.indexOf(text[i]));
    }
    return indices;
  }
Convert text string to integer indices.

@param {string} text Input text.
@returns {number[]} Indices of the characters of `text`.