<commit_before>$('document').ready(function () {
    var wick;
    var read = new Index();
    $('#fileRead').on('click', function () {
        var fileDetails = document.getElementById('filegangan').files[0];
        console.log(fileDetails);
        var fileName = fileDetails.name;
        read.readFile(fileDetails, function() {
            wick = read.files;
            // console.log(wick.docs.length);
        });
        $('#load').append('<span>Your File has been successfully loaded</span>');
    });
    $('#index').on('click', function(){
        alert('I am Index');
        var numberofDocs = read.getIndex(wick);
        // console.log(numberofDocs);
        $('#list').attr('data-badge',numberofDocs);
        });
});


class Index {
    constructor(){
        this.files = {};
    }
    readFile(fileDetails,callback){
        let fileName = fileDetails.name;
        let _this = this;
        let fs = new FileReader();
        fs.readAsText(fileDetails,'UTF-8');
        fs.onload = function(files){
            let result = JSON.parse(files.target.result);
            _this.files ={
                name: fileName,
                docs:result
            };<commit_msg>separation of jquery code into a separate file<commit_after>class Index {
    constructor(){
        this.files = {};
    }
    readFile(fileDetails,callback){
        let fileName = fileDetails.name;
        let _this = this;
        let fs = new FileReader();
        fs.readAsText(fileDetails,'UTF-8');
        fs.onload = function(files){
            let result = JSON.parse(files.target.result);
            _this.files ={
                name: fileName,
                docs:result
            };
{'fraction_non_alphanumeric': 0.14412285883047843, 'fraction_numerical': 0.0017720023626698169, 'mean_word_length': 2.019607843137255, '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': '2603885', 'n_tokens_mistral': 470, 'n_tokens_neox': 468, 'n_words': 94}