<commit_before>var fs = require('fs'),
    jsdom = require('jsdom');

var script_filenames = [
               "external/scripts/d3/d3.js",
               "external/scripts/jquery.js",
               "external/scripts/jquery-ui.js",
               "external/scripts/autocomplete.js",

               "scripts/caret.js",
               "scripts/history.js",
               "scripts/rhizicore.js",
               "scripts/textanalysis.js",
               "scripts/textanalysis-ui.js",
               "scripts/buttons.js",
               "scripts/drag_n_drop.js",
               "scripts/robot.js",
               "scripts/watchdog.js",
               "scripts/gant.js"].map(function(x) { return "../" + x; });

function dump_nodes(window) {
    var nodes = window.force.nodes();
    for(var i = 0 ; i < nodes.length; ++i) {
        console.log('nodes[' + nodes[i].id + '/' + nodes[i].type + '].[xy] = (' + nodes[i].x + ',' + nodes[i].y + ')');
    }
}

function dump_graphviz(window) {
    var i;
    var nodes = window.force.nodes();
    var links = window.force.links();
    var q = function(s) {
        if (s.search(' ') == -1) {
            return s;
        }
        return '"' + s + '"';
    };

    console.log('digraph {');
    for (i = 0 ; i < nodes.length; ++i) {
        if (nodes[i].type == 'bubble') {
            console.log(' BUBBLE;');
        } else {
            console.log(' ' + q(nodes[i].name) + ';');
        }
    }
    for (i = 0 ; i < links.length; ++i) {
        var link = links[i];
        console.log(' ' + q(link.source.name) + ' -> ' + q(link.target.name) + ';');
    }
    console.log('}');
}

var done = function (errors, window) {
    window.analyzeSentence(process.argv.join(" "), true);
    dump_graphviz(window);
    process.exit();
}

var env = jsdom.env({
    scripts: script_filenames,
    html: "<html><body></body></html>",
    created: function(errors, window) {<commit_msg>test_analyzer: correct command line arguments<commit_after>var fs = require('fs'),
    jsdom = require('jsdom');

var script_filenames = [
               "external/scripts/d3/d3.js",
               "external/scripts/jquery.js",
               "external/scripts/jquery-ui.js",
               "external/scripts/autocomplete.js",

               "scripts/caret.js",
               "scripts/history.js",
               "scripts/rhizicore.js",
               "scripts/textanalysis.js",
               "scripts/textanalysis-ui.js",
               "scripts/buttons.js",
               "scripts/drag_n_drop.js",
               "scripts/robot.js",
               "scripts/watchdog.js",
               "scripts/gant.js"].map(function(x) { return "../" + x; });

function dump_nodes(window) {
    var nodes = window.force.nodes();
    for(var i = 0 ; i < nodes.length; ++i) {
        console.log('nodes[' + nodes[i].id + '/' + nodes[i].type + '].[xy] = (' + nodes[i].x + ',' + nodes[i].y + ')');
    }
}

function dump_graphviz(window) {
    var i;
    var nodes = window.force.nodes();
    var links = window.force.links();
    var q = function(s) {
        if (s.search(' ') == -1) {
            return s;
        }
        return '"' + s + '"';
    };

    console.log('digraph {');
    for (i = 0 ; i < nodes.length; ++i) {
        if (nodes[i].type == 'bubble') {
            console.log(' BUBBLE;');
        } else {
            console.log(' ' + q(nodes[i].name) + ';');
        }
    }
    for (i = 0 ; i < links.length; ++i) {
        var link = links[i];
        console.log(' ' + q(link.source.name) + ' -> ' + q(link.target.name) + ';');
    }
    console.log('}');
}

var done = function (errors, window) {
    window.analyzeSentence(process.argv.slice(2).join(" "), true);
    dump_graphviz(window);
    process.exit();
}

var env = jsdom.env({
    scripts: script_filenames,
    html: "<html><body></body></html>",
    created: function(errors, window) {
{'fraction_non_alphanumeric': 0.19148387096774194, 'fraction_numerical': 0.0033548387096774194, 'mean_word_length': 1.8753709198813056, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, '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': '2935943', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1278, 'n_words': 218}