<commit_before>/*
 * Encog(tm) Core v0.1 - Javascript Version
 * http://www.heatonresearch.com/encog/
 * http://code.google.com/p/encog-java/

 * Copyright 2008-2012 Heaton Research, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * For more information on Heaton Research copyrights, licenses
 * and trademarks visit:
 * http://www.heatonresearch.com/copyright
 */

/**
 * Node.js includes
 */
//var jsdom = require("jsdom");
//var window = jsdom.jsdom().parentWindow;
libParent = {};

/**
 * The main Encog namespace.  This is the only global property created by Encog.
 * @type {*}
 */
var ENCOG = module.exports = ENCOG || {
    /**
     * The version of Encog that this is.
     * @property property
     * @type String
     * @final
     */
    VERSION : '1.0',

    /**
     * The Encog platform being used.
     * @property property
     * @type String
     * @final
     */
    PLATFORM : 'javascript',

    /**
     * The precision that Encog uses.
     * @property precision
     * @type String
     * @final
     */
    precision : 1e-10,

    /**
     * A newline character.
     * @property property
     * @type String
     * @final
     */
    NEWLINE : '\n',

    /**
     * The Encog type for activation functions.
     * @property ENCOG_TYPE_ACTIVATION
     * @type String
     * @final
     */
    ENCOG_TYPE_ACTIVATION : 'ActivationFunction',

    /**
     * The Encog type for RBF functions.
     * @property ENCOG_TYPE_ACTIVATION
     * @type String
     * @final
     */
    ENCOG_TYPE_RBF : 'RBF'
};

/**
 * The namespace function, used to define new namespaces.
 * @param namespaceString The namespace that is to be defined.
 * @method namespace
 * @return {Object} The newly created namespace, or existing one.
 */
ENCOG.namespace = function (namespaceString) {
    'use strict';

    var parts = namespaceString.split('.'),
        parent = libParent,
        currentPart = '',
        i,
        length;

    for (i = 0, length = parts.length; i < length; i += 1) {
        currentPart = parts[i];
        parent[currentPart] = parent[currentPart] || {};
        parent = parent[currentPart];
    }

    return parent;
};

ENCOG.namespace('ENCOG.ActivationSigmoid');
ENCOG.namespace('ENCOG.ActivationTANH');
ENCOG.namespace('ENCOG.ActivationLinear');
ENCOG.namespace('ENCOG.ActivationElliott');<commit_msg>updated encog lib with comments for the modifications for Node.js<commit_after>/*
 * Encog(tm) Core v0.1 - Javascript Version
 * http://www.heatonresearch.com/encog/
 * http://code.google.com/p/encog-java/

 * Copyright 2008-2012 Heaton Research, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * For more information on Heaton Research copyrights, licenses
 * and trademarks visit:
 * http://www.heatonresearch.com/copyright
 */

/**
 * Modified to work with Node.js
 * https://github.com/Thimira/encog-node
 */

/**
 * Modifications for Node.js.
 * defining a top level global variable to act as the parent frame for the ENCOG
 * namespace. This replaces the reference to the 'window' object from the
 * Javascript version.
 */
libParent = {};

/**
 * The main Encog namespace.  This is the only global property created by Encog.
 * @type {*}
 */
var ENCOG = module.exports = ENCOG || {
    /**
     * The version of Encog that this is.
     * @property property
     * @type String
     * @final
     */
    VERSION : '1.0',

    /**
     * The Encog platform being used.
     * @property property
     * @type String
     * @final
     */
    PLATFORM : 'javascript',

    /**
     * The precision that Encog uses.
     * @property precision
     * @type String
     * @final
     */
    precision : 1e-10,

    /**
     * A newline character.
     * @property property
     * @type String
     * @final
     */
    NEWLINE : '\n',

    /**
     * The Encog type for activation functions.
     * @property ENCOG_TYPE_ACTIVATION
     * @type String
     * @final
     */
    ENCOG_TYPE_ACTIVATION : 'ActivationFunction',

    /**
     * The Encog type for RBF functions.
     * @property ENCOG_TYPE_ACTIVATION
     * @type String
     * @final
     */
    ENCOG_TYPE_RBF : 'RBF'
};

/**
 * The namespace function, used to define new namespaces.
 * @param namespaceString The namespace that is to be defined.
 * @method namespace
 * @return {Object} The newly created namespace, or existing one.
 */
ENCOG.namespace = function (namespaceString) {
    'use strict';

    /**
     * Modifications for Node.js.
     * setting the defined global 'libParent' as the parent
     */
    var parts = namespaceString.split('.'),
        parent = libParent,
        currentPart = '',
        i,
        length;

    for (i = 0, length = parts.length; i < length; i += 1) {
        currentPart = parts[i];
        parent[currentPart] = parent[currentPart] || {};
        parent = parent[currentPart];
    }

    return parent;
};

ENCOG.namespace('ENCOG.ActivationSigmoid');
ENCOG.namespace('ENCOG.ActivationTANH');
ENCOG.namespace('ENCOG.ActivationLinear');
ENCOG.namespace('ENCOG.ActivationElliott');
{'fraction_non_alphanumeric': 0.1142433234421365, 'fraction_numerical': 0.006923837784371909, 'mean_word_length': 2.654819277108434, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 6, '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': '4462766', 'n_tokens_mistral': 1843, 'n_tokens_neox': 1782, 'n_words': 580}