<commit_before>'use strict';
var changeCase = require('change-case');
var upperCaseFirst = changeCase.upperCaseFirst;
var sentenceCase = changeCase.sentenceCase;

var fp = require('annofp');


module.exports = swaggerify(require('require-dir')('.', {recurse: true}));


function swaggerify(modules) {
    var ret = {};

    fp.each(function(module, definition) {
        var moduleName = upperCaseFirst(module);

        if(definition.index) {
            fp.each(function(name, def) {
                var key = name === 'index'? moduleName: moduleName + upperCaseFirst(name);

                if(def.properties) {
                    def.properties = generateDescriptions(key, def.properties);
                }

                ret[key] = def;
            }, definition);
        }
        else {
            ret[moduleName] = definition;
        }<commit_msg>Simplify import<commit_after>'use strict';
var changeCase = require('change-case');
var upperCaseFirst = changeCase.upperCaseFirst;
var sentenceCase = changeCase.sentenceCase;

var fp = require('annofp');


module.exports = swaggerify(require('require-dir')());


function swaggerify(modules) {
    var ret = {};

    fp.each(function(module, definition) {
        var moduleName = upperCaseFirst(module);

        if(definition.index) {
            fp.each(function(name, def) {
                var key = name === 'index'? moduleName: moduleName + upperCaseFirst(name);

                if(def.properties) {
                    def.properties = generateDescriptions(key, def.properties);
                }

                ret[key] = def;
            }, definition);
        }
        else {
            ret[moduleName] = definition;
        }
{'fraction_non_alphanumeric': 0.12485345838218054, 'fraction_numerical': 0.0, 'mean_word_length': 2.3017408123791103, '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': '5799625', 'n_tokens_mistral': 481, 'n_tokens_neox': 451, 'n_words': 93}