<commit_before>/// <reference path="../typings/browser.d.ts" />
/// <reference path="rates/ratewidgetcomponent.ts" />
/// <reference path="expenses/expensewidgetcomponent.ts" />
/// <reference path="filehandling/dragdrop.ts" />
let root = document.getElementById("root");
let handler = new FileHandling.FileHandler(root, {
    onchange: (files: FileList) => {
        for (let i = 0; i < files.length; i++) {
            console.log(files[i].path);
        }
    }
});

m.route.mode = "search";

m.route(root, "/", {
    "/": new RateWidget.RatesWidgetComponent(),
    "/expenses": new ExpenseWidget.ExpenseWidgetComponent()
});<commit_msg>read the dropped file as json<commit_after>/// <reference path="../typings/browser.d.ts" />
/// <reference path="rates/ratewidgetcomponent.ts" />
/// <reference path="expenses/expensewidgetcomponent.ts" />
/// <reference path="filehandling/dragdrop.ts" />
let root = document.getElementById("root");

let handler = new FileHandling.FileHandler(root, {
    onchange: (files: FileList) => {
        let reader = new FileReader();
        reader.onload = (e: Event) => {
            let data = JSON.parse(reader.result);
            console.log(data);
        };

        for (let i = 0; i < files.length; i++) {
            let file = files[i];
            reader.readAsText(file);
        }
    }
});

m.route.mode = "search";

m.route(root, "/", {
    "/": new RateWidget.RatesWidgetComponent(),
    "/expenses": new ExpenseWidget.ExpenseWidgetComponent()
});
{'fraction_non_alphanumeric': 0.1821214142761841, 'fraction_numerical': 0.00133422281521014, 'mean_word_length': 2.9473684210526314, 'pattern_counts': {'":': 4, '<': 13, '<?xml version=': 0, '>': 14, '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': '1625258', 'n_tokens_mistral': 466, 'n_tokens_neox': 458, 'n_words': 89}