<commit_before>KISSY.add("brix/core/dataset", function(S, Base) {
    function Dataset() {
        Dataset.superclass.constructor.apply(this, arguments);
    }
    Dataset.ATTRS = {
        data: {}
    };
    S.extend(Dataset, Base, {
        /**
         * 扩展数据，用于mastache渲染
         * @param {Object} renderer 代理方法对象
         * @param {Object} context  当前上下文环境
         * @param {String} prefix   前缀，防止相同brick方法覆盖
         */
        setRenderer : function(renderer,context,prefix) {
            var self = this, rr = renderer, mcName, wrapperName,data = self.get('data');
            if(rr) {
                var foo = function(mcName,wrapperName){
                    var mn = mcName, wn = wrapperName;
                    var fn = rr[mn][wn];
                    data[(prefix?prefix+"_":"")+mn + "_" + wn] = function() {
                        return fn.call(this, context, mn);
                    };
                };
                for(mcName in rr) {
                    for(wrapperName in rr[mcName]) {
                        foo(mcName,wrapperName);
                    }
                }
            }
        }
    });
    return Dataset;
}, {
    requires: ["base"]
});<commit_msg>重构 mcName 为 type，删除重复的变量名缩写<commit_after>KISSY.add("brix/core/dataset", function(S, Base) {
    function Dataset() {
        Dataset.superclass.constructor.apply(this, arguments);
    }
    Dataset.ATTRS = {
        data: {}
    };
    S.extend(Dataset, Base, {
        /**
         * 扩展数据，用于 mastache 渲染
         * @param {Object} renderer 代理方法对象
         * @param {Object} context  当前上下文环境
         * @param {String} prefix   前缀，防止相同 brick 方法覆盖
         */
        setRenderer: function(renderer, context, prefix) {
            var self = this,
                data = self.get('data'),
                type, wrapperName;
            prefix = prefix ? prefix + '_' : '';
            if (renderer) {
                var foo = function(type, wrapperName) {
                        var name = prefix + type + '_' + wrapperName,
                            fn = renderer[type][wrapperName];
                        data[name] = function() {
                            return fn.call(this, context, type);
                        };
                    };
                for (type in renderer) {
                    for (wrapperName in renderer[type]) {
                        foo(type, wrapperName);
                    }
                }
            }
        }
    });
    return Dataset;
}, {
    requires: ["base"]
});
{'fraction_non_alphanumeric': 0.12242472266244057, 'fraction_numerical': 0.0, 'mean_word_length': 1.2954545454545454, 'pattern_counts': {'":': 1, '<': 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': '3667348', 'n_tokens_mistral': 760, 'n_tokens_neox': 761, 'n_words': 142}