<commit_before>var compat = false;
var outputDir = "";

var pedanticMode = true; // check for terminating zeros (and possibly other unnecessary stuff in the future)

/// needs:
// util.js
// files.js
// //dirwalk.js //--not really yet
// convert.js

$(document).ready(function () {
	checkCompat();
	log("File API check: "+(compat?"success":"fail")+".");
	
	var files = [];
	
	$("#preset").change(function(){
		files = loadDir(this, /\.avs$/);
		log("Found "+files.length+" files in directory.");
	});
	
	$('#go').click(function() {
		for (var i = 0; i < files.length; i++) {
			loadFile(files[i], saveAvsAsJson);
		};
	});
});

function saveAvsAsJson (preset, name) {
	var json = [
		jsonKeyVal('name',name.substr(0,name.length-4)),
		jsonKeyVal('author','-'),
		convertPreset(preset)];
	$('#output').val(cJoin(json));
}<commit_msg>Fixed invalid json output.<commit_after>var compat = false;
var outputDir = "";

var pedanticMode = true; // check for terminating zeros (and possibly other unnecessary stuff in the future)

/// needs:
// util.js
// files.js
// //dirwalk.js //--not really yet
// convert.js

$(document).ready(function () {
	checkCompat();
	log("File API check: "+(compat?"success":"fail")+".");
	
	var files = [];
	
	$("#preset").change(function(){
		files = loadDir(this, /\.avs$/);
		log("Found "+files.length+" files in directory.");
	});
	
	$('#go').click(function() {
		for (var i = 0; i < files.length; i++) {
			loadFile(files[i], saveAvsAsJson);
		};
	});
});

function saveAvsAsJson (preset, name) {
	var json = [
		jsonKeyVal('name',name.substr(0,name.length-4)),
		jsonKeyVal('author','-'),
		convertPreset(preset)];
	$('#output').val("{\n"+cJoin(json)+"\n}");
}
{'fraction_non_alphanumeric': 0.2255772646536412, 'fraction_numerical': 0.003552397868561279, 'mean_word_length': 3.9852507374631267, 'pattern_counts': {'":': 2, '<': 5, '<?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': '4277101', 'n_tokens_mistral': 615, 'n_tokens_neox': 577, 'n_words': 133}