<commit_before>'use strict';

function dot(root) {
    var nodes = [];
    var edges = [];

    nodesAndEdges(root, nodes, edges);

    var gv = [
        'digraph g {',
            'graph [',
            '    rankdir = "LR"',
            '];',
            'node [',
            '    fontsize = "12"',
            '    shape = "none"',
            '];',
            'edge [',
            '    fontsize = "8"',
            '];',
    ];

    nodes.forEach(function(node) {
        gv.push(node2dot(node));
    });

    edges.forEach(function(edge) {
        gv.push(edge2dot(edge));
    });
<commit_msg>Inject a fake node to represent a final node result<commit_after>'use strict';

function dot(root) {
    var nodes = [];
    var edges = [];

    nodesAndEdges(root, nodes, edges);

    var gv = [
        'digraph g {',
            'graph [',
            '    rankdir = "LR"',
            '];',
            'node [',
            '    fontsize = "12"',
            '    shape = "none"',
            '];',
            'edge [',
            '    fontsize = "8"',
            '];',
    ];

    nodes.forEach(function(node) {
        gv.push(node2dot(node));
    });

    var resultNode = {
        id: function() { return 'result'; },
        getQuery: function() { return root.getQuery(); },
        toDot: function() {
            return {
                type: 'result',
                color: 'lightblue',
                nodes: {},
                attrs: {}
            };
        }
    };
    gv.push(node2dot(resultNode));
    gv.push(edge2dot([resultNode, root]));

    edges.forEach(function(edge) {
        gv.push(edge2dot(edge));
    });

{'fraction_non_alphanumeric': 0.16939890710382513, 'fraction_numerical': 0.007285974499089253, 'mean_word_length': 1.3509272467902995, 'pattern_counts': {'":': 0, '<': 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': '768871', 'n_tokens_mistral': 523, 'n_tokens_neox': 498, 'n_words': 91}