<commit_before>var http = require("http");
var url  = require('url');

var sys = require('sys');
var exec = require('child_process').exec;

http.createServer(function(request, response) {
    response.writeHead(200, {"Content-Type": "text/plain"});

    var url_parts = url.parse(request.url, true);
    var query = url_parts.query;

    console.log(query.message);

    if (!query.message) return;

    response.write("Saying: ");
    response.write("" + query.message);

    child = exec('say', function (error, stdout, stderr) {
        if (error !== null) {
            console.log('exec error: ' + error);
            console.log("STDOUT: " + stdout);
            console.log("STDERR: " + stderr);
            response.write("ERROR: " + error);
            response.write("STDOUT: " + stdout);
            response.write("STDERR: " + stderr);
        }
    });
    child.stdin.end(query.message);

    response.end("");

    return query.message;
}).listen(8888);<commit_msg>use `espeak` if say is not available<commit_after>var http = require("http");
var url  = require('url');

var sys = require('sys');
var exec = require('child_process').exec;

http.createServer(function(request, response) {
    response.writeHead(200, {"Content-Type": "text/plain"});

    var url_parts = url.parse(request.url, true);
    var query = url_parts.query;

    console.log(query.message);

    if (!query.message) return;

    response.write("Saying: ");
    response.write("" + query.message);

    child = exec('(say || espeak)', function (error, stdout, stderr) {
        if (error !== null) {
            console.log('exec error: ' + error);
            console.log("STDOUT: " + stdout);
            console.log("STDERR: " + stderr);
            response.write("ERROR: " + error);
            response.write("STDOUT: " + stdout);
            response.write("STDERR: " + stderr);
        }
    });
    child.stdin.end(query.message);

    response.end("");

    return query.message;
}).listen(8888);
{'fraction_non_alphanumeric': 0.17443609022556392, 'fraction_numerical': 0.007017543859649123, 'mean_word_length': 2.831094049904031, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6761041', 'n_tokens_mistral': 642, 'n_tokens_neox': 607, 'n_words': 122}