MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / getCharSet_

Method getCharSet_

lstm-text-generation/data.js:204–212  ·  view source on GitHub ↗

* Get the set of unique characters from text.

()

Source from the content-addressed store, hash-verified

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.

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected