<commit_before>#!/usr/bin/env node

//NPM Dependancies
var fs = require('fs');

//Setup list of sources
var sources = fs.readdirSync(sourceDir);

//Only retain *.json
for (var i = 0; i < sources.length; i++) {
    if (sources[i].indexOf('.json') == -1) {
        sources.splice(i, 1);
        i--;
    }
}

var total = sources.length;
var processed = [],
    unprocessed = [],
    cached = [],
    uncached = [],
    skip = [];



sources.forEach(function(source){
    fs.readFile(file, 'utf8', function (err, data) {
        if (err) {
            return new Error("Can't Access: '" + source + "'");
        }
        
        try {
            var data = JSON.parse(data);
        } catch (err) {
            return new Error("Invalid JSON: '" + source + "'");    
        }
        
        if (data.processed)
            processed.push(source);
        else
            unprocessed.push(source);
        
        if (data.cached)
            cached.push(source);
        else
            uncached.push(source);
        
        if (data.skip)
            skip.push(source);
    });
});

console.log("OpenAddresses Stats Report\n");
console.log("Total Sources: " + total);
console.log("-------------------");
console.log("Cached: " + cached.length);
console.log("Uncached: " + total - cached.length);
console.log("Processed: " + processed.length);
console.log("Unprocessed: " + total - processed.length);<commit_msg>Total Stats<commit_after>#!/usr/bin/env node

//NPM Dependancies
var fs = require('fs');

//Setup list of sources
var sources = fs.readdirSync(sourceDir);

//Only retain *.json
for (var i = 0; i < sources.length; i++) {
    if (sources[i].indexOf('.json') == -1) {
        sources.splice(i, 1);
        i--;
    }
}

var total = sources.length;
var processed = [],
    unprocessed = [],
    cached = [],
    uncached = [],
    skip = [];



sources.forEach(function(source){
    fs.readFile(file, 'utf8', function (err, data) {
        if (err) {
            return new Error("Can't Access: '" + source + "'");
        }
        
        try {
            var data = JSON.parse(data);
        } catch (err) {
            return new Error("Invalid JSON: '" + source + "'");    
        }
        
        if (data.processed)
            processed.push(source);
        else
            unprocessed.push(source);
        
        if (data.cached)
            cached.push(source);
        else
            uncached.push(source);
        
        if (data.skip)
            skip.push(source);
    });
});

console.log("OpenAddresses Stats Report\n");
console.log("Total Sources: " + total);
console.log("-------------------");
console.log("Cached: " + cached.length);
console.log("Uncached: " + total - cached.length);
console.log("Processed: " + processed.length);
console.log("Unprocessed: " + total - processed.length);

console.log("List of Uncached:");
uncached.forEach(Function(source) {
    console.log("  " + source);
});

console.log("List of Unprocessed:");
uncached.forEach(Function(source) {
    console.log("  " + source);
});
{'fraction_non_alphanumeric': 0.17937806873977086, 'fraction_numerical': 0.002618657937806874, 'mean_word_length': 2.074446680080483, 'pattern_counts': {'":': 0, '<': 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': '5114762', 'n_tokens_mistral': 950, 'n_tokens_neox': 921, 'n_words': 198}