<commit_before>/**
 * Summmary
 *
 * Takes a full file list and returns a object of summary data.
 */
module.exports = function bval (fileList) {
    var summary = {
        sessions: [],
        subjects: [],
        runs:     [],
        tasks:    [],
        modalities: []
    };

    for (var fileKey in fileList) {
        var file = fileList[fileKey];
        var path = file.relativePath;

        var checks = {
            'ses':  'sessions',
            'sub':  'subjects',
            'run':  'runs',
            'task': 'tasks'
        };

        for (var checkKey in checks) {
            // var check = checks[i];
            if (path.indexOf(checkKey + '-') > -1) {
                var task = path.slice(path.indexOf(checkKey + '-'));
                    task = task.slice(0, task.indexOf('/'));
                    if (task.indexOf('_') > -1) {task = task.slice(0, task.indexOf('_'));}
                    task = task.slice(checkKey.length + 1);
                if (summary[checks[checkKey]].indexOf(task) === -1) {summary[checks[checkKey]].push(task);}
            }
        }

        if (path.endsWith('.nii') || path.endsWith('.nii.gz')) {
            var pathParts = path.split('_');
            var suffix    = pathParts[pathParts.length -1];
                suffix    = suffix.slice(0, suffix.indexOf('.'));
            if (summary.modalities.indexOf(suffix) === -1) {summary.modalities.push(suffix);}
        }

    }

    // console.log(summary);
    return summary;
};<commit_msg>Updated conditions to work with browser data<commit_after>/**
 * Summmary
 *
 * Takes a full file list and returns a object of summary data.
 */
module.exports = function bval (fileList) {
    var summary = {
        sessions: [],
        subjects: [],
        runs:     [],
        tasks:    [],
        modalities: []
    };

    for (var fileKey in fileList) {
        var file = fileList[fileKey];
        var path = file.relativePath;

        var checks = {
            'ses':  'sessions',
            'sub':  'subjects',
            'run':  'runs',
            'task': 'tasks'
        };

        for (var checkKey in checks) {
            if (path && path.indexOf(checkKey + '-') > -1) {
                var task = path.slice(path.indexOf(checkKey + '-'));
                    task = task.slice(0, task.indexOf('/'));
                    if (task.indexOf('_') > -1) {task = task.slice(0, task.indexOf('_'));}
                    task = task.slice(checkKey.length + 1);
                if (summary[checks[checkKey]].indexOf(task) === -1) {summary[checks[checkKey]].push(task);}
            }
        }

        if (path && (path.endsWith('.nii') || path.endsWith('.nii.gz'))) {
            var pathParts = path.split('_');
            var suffix    = pathParts[pathParts.length -1];
                suffix    = suffix.slice(0, suffix.indexOf('.'));
            if (summary.modalities.indexOf(suffix) === -1) {summary.modalities.push(suffix);}
        }

    }

    return summary;
};
{'fraction_non_alphanumeric': 0.1627751834556371, 'fraction_numerical': 0.00600400266844563, 'mean_word_length': 1.6752899197145406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '607964', 'n_tokens_mistral': 908, 'n_tokens_neox': 883, 'n_words': 196}