getRandomSlice() {
    const startIndex =
        Math.round(Math.random() * (this.textLen_ - this.sampleLen_ - 1));
    const textSlice = this.slice_(startIndex, startIndex + this.sampleLen_);
    return [textSlice, this.textToIndices(textSlice)];
  }
Get a random slice of text data.

@returns {[string, number[]} The string and index representation of the
  same slice.