<commit_before>/*
 * grunt-google-translate
 * https://github.com/dolanmiu/grunt-google-translate
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT license.
 */

/*jslint nomen: true */
/*globals module, require */
var _ = require('lodash');
var Q = require('q');

function deepTraverseJson(json, lambda) {
    'use strict';

    _.forOwn(json, function (value, key) {
        if (_.isObject(value)) {
            deepTraverseJson(value, lambda);
            return;
        }
        lambda(json, value, key);
    });
}

function translate(origJson, googleTranslate, source, target, destPath) {
    'use strict';

    var deferred = Q.defer(),
        jsonReferenceArray = [],
        sourceJson = _.cloneDeep(origJson);

    deepTraverseJson(sourceJson, function (parent, value, key) {
        jsonReferenceArray.push({
            parent: parent,
            value: value,<commit_msg>removed jslint error for regex<commit_after>/*
 * grunt-google-translate
 * https://github.com/dolanmiu/grunt-google-translate
 *
 * Copyright (c) 2015 <NAME>
 * Licensed under the MIT license.
 */

/*jslint nomen: true, regexp: true*/
/*globals module, require */
var _ = require('lodash');
var Q = require('q');

function deepTraverseJson(json, lambda) {
    'use strict';

    _.forOwn(json, function (value, key) {
        if (_.isObject(value)) {
            deepTraverseJson(value, lambda);
            return;
        }
        lambda(json, value, key);
    });
}

function translate(origJson, googleTranslate, source, target, destPath) {
    'use strict';

    var deferred = Q.defer(),
        jsonReferenceArray = [],
        sourceJson = _.cloneDeep(origJson);

    deepTraverseJson(sourceJson, function (parent, value, key) {
        jsonReferenceArray.push({
            parent: parent,
            value: value,
{'fraction_non_alphanumeric': 0.13516483516483516, 'fraction_numerical': 0.004395604395604396, 'mean_word_length': 2.762396694214876, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1328822', 'n_tokens_mistral': 560, 'n_tokens_neox': 542, 'n_words': 133}