<commit_before>(function(window){
    'use strict';

    var reader = new XMLHttpRequest() || new ActiveXObject('MSXML2.XMLHTTP');

    function readFile(filePath,callback) {
        reader.open('get', filePath, true); 
        reader.onreadystatechange = function(){
            if(reader.readyState === 4) {
                if(reader.status === 200){
                    callback(true,reader.responseText);
                }else{
                    callback(false);
                }
            }
        };
        reader.send(null);
    }


    function define_fortune(){
        var fortune = {};
        var fileContents;
        var filePath;

        function getRandomLine(callback){
            var random = Math.floor(Math.random() * fileContents.length);
            var line = fileContents[random];
            return line;
        }

        function setFile(callback,filePath){
            if(typeof filePath === 'undefined'){
                filePath = 'fortunes.txt';
            }

            readFile(filePath, function(loaded,content){
                if(loaded){
                    fileContents = content.split("\n");<commit_msg>changed setFile method to read the default quotes file dynamically<commit_after>(function(window){
    'use strict';

    var reader = new XMLHttpRequest() || new ActiveXObject('MSXML2.XMLHTTP');

    function readFile(filePath,callback) {
        reader.open('get', filePath, true); 
        reader.onreadystatechange = function(){
            if(reader.readyState === 4) {
                if(reader.status === 200){
                    callback(true,reader.responseText);
                }else{
                    callback(false);
                }
            }
        };
        reader.send(null);
    }


    function define_fortune(){
        var fortune = {};
        var fileContents;
        var filePath;

        function getRandomLine(callback){
            var random = Math.floor(Math.random() * fileContents.length);
            var line = fileContents[random];
            return line;
        }

        function setFile(callback,filePath){
            if(typeof filePath === 'undefined'){
                var scripts = document.getElementsByTagName("script"),
                src = scripts[scripts.length-1].src;
                var fileFolder = src.substr(0, src.lastIndexOf("/"));
                filePath = fileFolder + '/quotes.txt';
            }

            readFile(filePath, function(loaded,content){
                if(loaded){
                    fileContents = content.split("\n");
{'fraction_non_alphanumeric': 0.11530970003895598, 'fraction_numerical': 0.004674717569146864, 'mean_word_length': 1.7203389830508475, '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': '5056034', 'n_tokens_mistral': 670, 'n_tokens_neox': 624, 'n_words': 128}