{"size": 489, "ext": "js", "max_stars_repo_path": "demo/speech2text_demo.js", "max_stars_repo_name": "liyang007700/watson-robot-raspberry", "max_stars_repo_stars_event_min_datetime": "2017-01-12T13:39:54.000Z", "max_stars_repo_stars_event_max_datetime": "2017-02-13T12:00:24.000Z", "max_issues_repo_path": "demo/speech2text_demo.js", "max_issues_repo_name": "liyang007700/watson-robot-raspberry", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "demo/speech2text_demo.js", "max_forks_repo_name": "liyang007700/watson-robot-raspberry", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.45, "max_line_length": 76, "alphanum_fraction": 0.6400817996}
/*jshint esversion: 6 */
let speechToTextStream = require('../speech2text.js');
let through2 = require('through2');
let text = '';

let stream = through2({ objectMode: true }, function(chunk, enc, callback) {
    let string = chunk.toString()
    let result = string.replace(/\n/, '').toUpperCase().split(/[ \t]/)

    this.push(result)
    callback();
});

stream.on('data', function(data) {
    text += data.join(' ');
    console.log(text);
});

speechToTextStream.stream.pipe(stream);
