<commit_before>imports.gi.versions.WebKit2 = '4.0';

const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;

const Application = imports.app.application;
const Config = imports.app.config;
const EncyclopediaModel = imports.app.encyclopedia.model;
const EncyclopediaPresenter = imports.app.encyclopedia.presenter;
const EncyclopediaView = imports.app.encyclopedia.view;
const WebkitContextSetup = imports.app.webkitContextSetup;

const ENCYCLOPEDIA_APP_ID = 'com.endlessm.encyclopedia-en';

const EndlessEncyclopedia = new Lang.Class({
    Name:'EndlessEncyclopedia',
    Extends: Application.Application,

    _init: function (props={}) {
        this.parent(props);
    },

    vfunc_window_removed: function (win) {
        if (this._view === win) {
            this._view = null;
            this._presenter = null;
        }
        this.parent(win);
    },

    ensure_presenter: function () {
        if (this._presenter !== null)
            return;

        // Load web extensions for translating
        WebkitContextSetup.register_webkit_extensions(this.application_id);

        // Register resource
        let resource = Gio.Resource.load(Config.PKGDATADIR + '/eos-knowledge.gresource');
        resource._register();

        this._model = new EncyclopediaModel.EncyclopediaModel();
        this._view = new EncyclopediaView.EncyclopediaView({<commit_msg>encyclopedia/runner: register resource before imports<commit_after>imports.gi.versions.WebKit2 = '4.0';

const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;

const Config = imports.app.config;
// Register resource
let resource = Gio.Resource.load(Config.PKGDATADIR + '/eos-knowledge.gresource');
resource._register();

const Application = imports.app.application;
const EncyclopediaModel = imports.app.encyclopedia.model;
const EncyclopediaPresenter = imports.app.encyclopedia.presenter;
const EncyclopediaView = imports.app.encyclopedia.view;
const WebkitContextSetup = imports.app.webkitContextSetup;

const ENCYCLOPEDIA_APP_ID = 'com.endlessm.encyclopedia-en';

const EndlessEncyclopedia = new Lang.Class({
    Name:'EndlessEncyclopedia',
    Extends: Application.Application,

    _init: function (props={}) {
        this.parent(props);
    },

    vfunc_window_removed: function (win) {
        if (this._view === win) {
            this._view = null;
            this._presenter = null;
        }
        this.parent(win);
    },

    ensure_presenter: function () {
        if (this._presenter !== null)
            return;

        // Load web extensions for translating
        WebkitContextSetup.register_webkit_extensions(this.application_id);

        this._model = new EncyclopediaModel.EncyclopediaModel();
        this._view = new EncyclopediaView.EncyclopediaView({
{'fraction_non_alphanumeric': 0.10956036287508723, 'fraction_numerical': 0.00209351011863224, 'mean_word_length': 3.3837920489296636, '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': '7460721', 'n_tokens_mistral': 900, 'n_tokens_neox': 836, 'n_words': 167}