<commit_before>/* global define */
define('rest.resource', ['isArray'], function (isArray) {
    // https://gist.github.com/pduey/2764606

    function clone(hash) {
        return JSON.parse(JSON.stringify(hash));
    }

    function parseUrl(url, hash) {
        for (var e in hash) {
            if (hash.hasOwnProperty(e)) {
                var regExp = new RegExp(':(' + e + ')\\b', 'g');
                if (regExp.test(url)) {
                    url = url.replace(regExp, hash[e]);
                    delete hash[e];
                }
            }
        }
        return url;
    }

    function hashToSearch(hash) {
        var search = '';
        for (var k in hash) {
            if (isArray(hash[k])) {
                for (var i = 0; i < hash[k].length; i++) {
                    search += !search ? '?' : '&';
                    search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k][i]);
                }
            } else {
                search += !search ? '?' : '&';
                search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k]);
            }<commit_msg>fixed resource url<commit_after>/* global define */
define('rest.resource', ['isArray'], function (isArray) {
    // https://gist.github.com/pduey/2764606

    function clone(hash) {
        return JSON.parse(JSON.stringify(hash));
    }

    function parseUrl(url, hash) {
        for (var e in hash) {
            if (hash.hasOwnProperty(e)) {
                var regExp = new RegExp(':(' + e + ')\\b', 'g');
                if (regExp.test(url)) {
                    url = url.replace(regExp, hash[e]);
                    delete hash[e];
                }
            }
        }
        url = url.replace(/\/:\w+/gi, ""); // strip any "/:ids" that were still remaining
        url = url.replace(/\/$/gi, "") // strip trailing slash "/"
        return url;
    }

    function hashToSearch(hash) {
        var search = '';
        for (var k in hash) {
            if (isArray(hash[k])) {
                for (var i = 0; i < hash[k].length; i++) {
                    search += !search ? '?' : '&';
                    search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k][i]);
                }
            } else {
                search += !search ? '?' : '&';
                search += encodeURIComponent(k) + '=' + encodeURIComponent(hash[k]);
            }
{'fraction_non_alphanumeric': 0.16597164303586323, 'fraction_numerical': 0.006672226855713094, 'mean_word_length': 1.4605128205128206, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3920350', 'n_tokens_mistral': 722, 'n_tokens_neox': 705, 'n_words': 150}