* Get the set of unique characters from text.
()
| 202 | * Get the set of unique characters from text. |
| 203 | */ |
| 204 | getCharSet_() { |
| 205 | this.charSet_ = []; |
| 206 | for (let i = 0; i < this.textLen_; ++i) { |
| 207 | if (this.charSet_.indexOf(this.textString_[i]) === -1) { |
| 208 | this.charSet_.push(this.textString_[i]); |
| 209 | } |
| 210 | } |
| 211 | this.charSetSize_ = this.charSet_.length; |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Convert all training text to integer indices. |