<commit_before>//    underi18n v0.1

//    (c) 2012 <NAME>, Crypho AS
//    Backbone.xmpp is distributed under the MIT license.
//    http://github.com/ggozad/underi18n

(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery', 'underscore'], function ($, _) {
            return (root.underi18n = factory($, _));
        });
    } else {
        // Browser globals
        root.underi18n = factory($, _);
    }

}(this, function ($, _) {

    var underi18n = {

        MessageFactory: (function () {
            var MessageFactory = function (catalog) {
                this.translate = function (msgid, keywords) {
                    var msgstr  = catalog[msgid] ? catalog[msgid] : msgid;
                    if (keywords) {
                        var regexp;
                        _.each(keywords, function (val, key) {
                            msgstr = msgstr.replace('${'+key+'}', val);
                        });
                    }
                    return msgstr;
                };
            };
            return function (catalog) {
                return new MessageFactory(catalog).translate;
            };
        })(),

        template: function (str, factory) {
            var s = _.templateSettings;
            return str.replace(s.translate, function (match, code) {
                return factory(
                    code
                    .replace(/^\s+|\s+$/g, '')
                );
            }).replace(/\$\{(.*?)\}/g, function (m, c) {
                return s.i18nVarLeftDel + c + s.i18nVarRightDel;
            });
        }
    };

    _.templateSettings.translate = /<%_([\s\S]+?)%>/g;
    _.templateSettings.i18nVarLeftDel = '<%=';
    _.templateSettings.i18nVarRightDel = '%>';
    return underi18n;
}));

<commit_msg>Use own template settings, this does not really require underscore<commit_after>//    underi18n v0.1

//    (c) 2012 <NAME>, Crypho AS
//    Backbone.xmpp is distributed under the MIT license.
//    http://github.com/ggozad/underi18n

(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery', 'underscore'], function ($, _) {
            return (root.underi18n = factory($, _));
        });
    } else {
        // Browser globals
        root.underi18n = factory($, _);
    }

}(this, function ($, _) {

    var underi18n = {

        MessageFactory: (function () {
            var MessageFactory = function (catalog) {
                this.translate = function (msgid, keywords) {
                    var msgstr  = catalog[msgid] ? catalog[msgid] : msgid;
                    if (keywords) {
                        var regexp;
                        _.each(keywords, function (val, key) {
                            msgstr = msgstr.replace('${'+key+'}', val);
                        });
                    }
                    return msgstr;
                };
            };
            return function (catalog) {
                return new MessageFactory(catalog).translate;
            };
        })(),

        template: function (str, factory) {
            var s = this.templateSettings;
            return str.replace(s.translate, function (match, code) {
                return factory(
                    code
                    .replace(/^\s+|\s+$/g, '')
                );
            }).replace(/\$\{(.*?)\}/g, function (m, c) {
                return s.i18nVarLeftDel + c + s.i18nVarRightDel;
            });
        },

        templateSettings: {
            translate: /<%_([\s\S]+?)%>/g,
            i18nVarLeftDel: '<%=',
            i18nVarRightDel: '%>'
        }
    };

    return underi18n;
}));


{'fraction_non_alphanumeric': 0.14259405419626414, 'fraction_numerical': 0.013680610365693239, 'mean_word_length': 1.3718028696194635, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6220841', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1027, 'n_words': 228}