<commit_before>var process = require('process')
var fs = require('fs')
var nearley = require('nearley')
var grammar = require('./grammar')

var p = new nearley.Parser(grammar.ParserRules, grammar.ParserStart)
var filename = process.argv[2]
var data = fs.readFileSync(filename, 'utf8')
var result = p.feed(data)

console.dir(result.results[0], {
    depth: null
})
<commit_msg>Update milk.js<commit_after>var process = require('process')
var fs = require('fs')
var nearley = require('nearley')
var grammar = require('./grammar')

var p = new nearley.Parser(grammar.ParserRules, grammar.ParserStart)
var filename = process.argv[2]
var data = fs.readFileSync(filename, 'utf8')
var result = p.feed(data)

console.log(result.results.length)
console.dir(result.results, {
    depth: null
})

{'fraction_non_alphanumeric': 0.1503184713375796, 'fraction_numerical': 0.006369426751592357, 'mean_word_length': 5.605042016806722, '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': '4562380', 'n_tokens_mistral': 261, 'n_tokens_neox': 254, 'n_words': 62}