<commit_before>'use strict';
require("amd-loader");
var rng_parse = require("./lib/salve/validate");
var fs = require("fs");
var path = require("path");
var sax = require("sax");
var parser = sax.parser(true, {xmlns: true});

function fileAsString(p) {
    return fs.readFileSync(path.resolve(p), "utf8").toString();
}

var source = fileAsString(process.argv[2]);
var xml_source = fileAsString(process.argv[3]);

var tree = rng_parse.constructTree(source);

var walker = tree.newWalker();

function fireEvent() {
    var ev = new rng_parse.Event(Array.prototype.slice.call(arguments));
    var ret = walker.fireEvent(ev);
    if (ret !== true) {
        ret.forEach(function (x) {
            console.log("on event " + ev);
            console.log(x.toString());
        });
    }
}

var tag_stack = [];
parser.onopentag = function (node) {
    fireEvent("enterStartTag", node.uri, node.local);<commit_msg>Fixed path.<commit_after>'use strict';
require("amd-loader");
var rng_parse = require("./validate");
var fs = require("fs");
var path = require("path");
var sax = require("sax");
var parser = sax.parser(true, {xmlns: true});

function fileAsString(p) {
    return fs.readFileSync(path.resolve(p), "utf8").toString();
}

var source = fileAsString(process.argv[2]);
var xml_source = fileAsString(process.argv[3]);

var tree = rng_parse.constructTree(source);

var walker = tree.newWalker();

function fireEvent() {
    var ev = new rng_parse.Event(Array.prototype.slice.call(arguments));
    var ret = walker.fireEvent(ev);
    if (ret !== true) {
        ret.forEach(function (x) {
            console.log("on event " + ev);
            console.log(x.toString());
        });
    }
}

var tag_stack = [];
parser.onopentag = function (node) {
    fireEvent("enterStartTag", node.uri, node.local);
{'fraction_non_alphanumeric': 0.17277777777777778, 'fraction_numerical': 0.0033333333333333335, 'mean_word_length': 3.907356948228883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '3579491', 'n_tokens_mistral': 597, 'n_tokens_neox': 590, 'n_words': 126}