<commit_before>function (doc) {
    var toType, keys, attachments;
 // toType was written by <NAME>:
 // http://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/
    toType = function (obj) {
        return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
    };
    keys = Object.keys(doc);
    keys.forEach(function (key, idx) {
        var value, type, subject, predicate, object, attachments;
        value = doc[key];
        if (key.charAt(0) !== "_") {
         // Ignore CouchDB-specific properties that start with "_".
            type = toType(value);
         // URL encode key and property.
            subject = encodeURIComponent(doc._id);
            predicate = encodeURIComponent(key);
         // Stringify value.
            object = JSON.stringify(value);
            emit([subject, predicate, object], {
                objectType: type
            });
        } else if (key === "_attachments") {
         // Special treatment for attachments.
            attachments = Object.keys(doc["_attachments"]);
            attachments.forEach(function (attachment) {
                emit([doc._id, "attachment", attachment], {
                    objectType: "_attachment"
                });
            });
        }
    });
}<commit_msg>Clarify property handling.<commit_after>function (doc) {
    var toType, keys, attachments;
 // toType was written by <NAME>:
 // http://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/
    toType = function (obj) {
        return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
    };
    keys = Object.keys(doc);
    keys.forEach(function (key, idx) {
        var value, type, subject, predicate, object, attachments;
        value = doc[key];
        if (key.charAt(0) !== "_") {
         // Ignore CouchDB-specific properties that start with "_".
            type = toType(value);
         // URL encode key and property.
            subject = encodeURIComponent(doc._id);
            predicate = encodeURIComponent(key);
         // Stringify value.
            object = JSON.stringify(value);
            emit([subject, predicate, object], {
                objectType: type
            });
        } else {
            if (key === "_attachments") {
             // Special treatment for attachments.
                attachments = Object.keys(doc["_attachments"]);
                attachments.forEach(function (attachment) {
                    emit([doc._id, "attachment", attachment], {
                        objectType: "_attachment"
                    });
                });
            }
        }
    });
}
{'fraction_non_alphanumeric': 0.14029180695847362, 'fraction_numerical': 0.0074822297044519264, 'mean_word_length': 1.8386411889596603, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1163180', 'n_tokens_mistral': 734, 'n_tokens_neox': 709, 'n_words': 154}