<commit_before>/*
 * Naive commandline parser
 */

var fs = require('fs');
var path = require('path');
var protagonist = require('../build/Release/protagonist');
//var protagonist = require('protagonist');

// Process arguments
var args = process.argv.slice(2);
if (typeof args == 'undefined' || args.length !== 1) {
  var scriptName = path.basename(process.argv[1]);
  console.log('usage: ' + scriptName + ' <input file>\n');
  process.exit(0);
}
<commit_msg>Add Segfault handler<commit_after>/*
 * Naive commandline parser
 */

var fs = require('fs');
var path = require('path');
var protagonist = require('../build/Release/protagonist');
//var protagonist = require('protagonist');

// Add Segfault handler
var segfaultHandler = require('segfault-handler');
segfaultHandler.registerHandler();

// Process arguments
var args = process.argv.slice(2);
if (typeof args == 'undefined' || args.length !== 1) {
  var scriptName = path.basename(process.argv[1]);
  console.log('usage: ' + scriptName + ' <input file>\n');
  process.exit(0);
}

{'fraction_non_alphanumeric': 0.18015414258188825, 'fraction_numerical': 0.007707129094412331, 'mean_word_length': 4.740331491712707, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1262580', 'n_tokens_mistral': 329, 'n_tokens_neox': 317, 'n_words': 79}