MCPcopy Index your code
hub / github.com/BrainJS/brain.js / DataFormatter

Function DataFormatter

browser.js:5088–5104  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

5086 */
5087var DataFormatter = function () {
5088 function DataFormatter(values) {
5089 var maxThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
5090
5091 _classCallCheck(this, DataFormatter);
5092
5093 if (values === undefined) return;
5094
5095 this.values = values;
5096 // go over all characters and keep track of all unique ones seen
5097 // count up all characters
5098 this.indexTable = {};
5099 this.characterTable = {};
5100 this.characters = [];
5101 this.specialIndexes = [];
5102 this.buildCharactersFromIterable(values);
5103 this.buildTables(maxThreshold);
5104 }
5105
5106 _createClass(DataFormatter, [{
5107 key: 'buildCharactersFromIterable',

Callers

nothing calls this directly

Calls 3

buildTablesMethod · 0.80
_classCallCheckFunction · 0.70

Tested by

no test coverage detected