<commit_before>'use strict';

var q = require('q'),
    rimraf = require('rimraf'),
    tmp = require('tmp'),
    exec = require('child_process').exec,
    spawn = require('child_process').spawn,
    nconf = require('nconf'),
    sprintf = require('sprintf-js').sprintf;

module.exports = function(root) {

    /**
     * The gebo's root directory must be
     * specified in order to read a custom
     * gebo.json configuration file.
     */
    if(!root) {
      root = __dirname;
    }
          
    /**
     * Load gebo configurations
     */
    nconf.file({ file: root + '/gebo-docs.json' });

    /**
     * Start an unoconv listener
     *
     * @returns promise
     */
//    function _startUnoconvListener() {
//        var deferred = q.defer();
//
//        // Get unoconv PID
//        var command = 'ps ax | grep unoconv | grep -v grep | awk \'{print $1}\''
//        exec(command, function(err, stdout, stderr) {
//            var unoconvId = stdout;
//
//            // Get LibreOffice PID
//            command = 'ps ax | grep soffice.bin | grep -v grep | awk \'{print $1}\''
//            exec(command, function(err, stdout, stderr) {
//                var sofficeId = stdout;
//
//                // Kill the existing processes
//                command = 'kill ' + unoconvId + ' ' + sofficeId;
//                exec(command, function(err, stdout, stderr) {
//
//                    // Start the unoconv listener
//                    command = 'unoconv --listener &';<commit_msg>Reference config from module directory, if not specified<commit_after>'use strict';

var q = require('q'),
    rimraf = require('rimraf'),
    tmp = require('tmp'),
    exec = require('child_process').exec,
    spawn = require('child_process').spawn,
    nconf = require('nconf'),
    sprintf = require('sprintf-js').sprintf;

module.exports = function(root) {

    /**
     * The gebo's root directory must be
     * specified in order to read a custom
     * gebo.json configuration file.
     */
    if(!root) {
      root = './';
    }
          
    /**
     * Load gebo configurations
     */
    nconf.file({ file: root + '/gebo-docs.json' });

    /**
     * Start an unoconv listener
     *
     * @returns promise
     */
//    function _startUnoconvListener() {
//        var deferred = q.defer();
//
//        // Get unoconv PID
//        var command = 'ps ax | grep unoconv | grep -v grep | awk \'{print $1}\''
//        exec(command, function(err, stdout, stderr) {
//            var unoconvId = stdout;
//
//            // Get LibreOffice PID
//            command = 'ps ax | grep soffice.bin | grep -v grep | awk \'{print $1}\''
//            exec(command, function(err, stdout, stderr) {
//                var sofficeId = stdout;
//
//                // Kill the existing processes
//                command = 'kill ' + unoconvId + ' ' + sofficeId;
//                exec(command, function(err, stdout, stderr) {
//
//                    // Start the unoconv listener
//                    command = 'unoconv --listener &';
{'fraction_non_alphanumeric': 0.15088757396449703, 'fraction_numerical': 0.0013149243918474688, 'mean_word_length': 1.7121212121212122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '28205', 'n_tokens_mistral': 940, 'n_tokens_neox': 909, 'n_words': 242}