<commit_before>package plugins.Sharesite;

import plugins.Sharesite.common.Logger;
import plugins.Sharesite.webui.WebInterface;
import freenet.l10n.BaseL10n;
import freenet.l10n.PluginL10n;
import freenet.l10n.BaseL10n.LANGUAGE;
import freenet.pluginmanager.FredPlugin;
import freenet.pluginmanager.FredPluginBaseL10n;
import freenet.pluginmanager.FredPluginL10n;
import freenet.pluginmanager.FredPluginRealVersioned;
import freenet.pluginmanager.FredPluginThreadless;
import freenet.pluginmanager.FredPluginVersioned;
import freenet.pluginmanager.PluginRespirator;

import java.awt.GraphicsEnvironment;

/**
 * This is the main class, the first one executed by Freenet.
 * Only one instance exists, and can be accessed from anywhere using
 * the global variable. The most logical way to reach different things.
 */
public class Plugin implements FredPlugin, FredPluginVersioned, FredPluginRealVersioned, FredPluginL10n, FredPluginBaseL10n, FredPluginThreadless {
	public static final String version = "0.2.8";
	public static final long realVersion = 2;
	public static final String freesite = "USK@dCnkUL22fAmKbKg-Cftx9j2m4IwyWB0QbGoiq1RSLP8,4d1TDqwRr4tYlsubLrQK~c4h0~FtmE-OXCDmFiI8BB4,AQACAAE/Sharesite/-1/";
	public static boolean isPreRelease = false;

	private PluginL10n plugL10n;

	public static Plugin instance;
	public PluginRespirator pluginRespirator;
	public BaseL10n l10n;

	public Logger logger;
	public Inserter inserter;
	public Database database;
	public WebInterface webInterface;

	public Plugin() {
		instance = this;
	}

	@Override
	public void runPlugin(PluginRespirator pr) {
		pluginRespirator = pr;

		logger = new Logger("Sharesite.log");
		logger.putstr("Loading of Sharesite " + version + " begins!");

		logger.putstr("Setting GraphicsEnvironment to headless");
		System.setProperty("java.awt.headless","true");

		logger.putstr("Preparing the inserter ...");
		inserter = new Inserter();
		inserter.start();

		logger.putstr("Loading the database ...");
		database = new Database();

		logger.putstr("Registering the web interface ...");
		webInterface = new WebInterface();
		webInterface.createInterface();

		logger.putstr("Successfully started!");
	}

	@Override
	public void terminate() {
		logger.putstr("Terminating ...");
		webInterface.removeInterface();
		inserter.terminate();
		logger.close();
	}

	@Override
	public String getVersion() {
		return version;
	}

	@Override
	public long getRealVersion() {
		return realVersion;
	}

	@Override
	public String getString(String key) {
		return l10n.getString(key);
	}

	@Override
	public void setLanguage(LANGUAGE newLanguage) {
		plugL10n = new PluginL10n(this, newLanguage);
		l10n = plugL10n.getBase();
	}

	@Override
	public String getL10nFilesBasePath() {
		return "plugins/Sharesite/l10n/";
	}

	@Override
	public String getL10nFilesMask() {
		return "lang_${lang}.l10n";
	}

	@Override
	public String getL10nOverrideFilesMask() {
		return "Sharesite_lang_${lang}.override.l10n";
	}

	@Override
	public ClassLoader getPluginClassLoader() {
		return Plugin.class.getClassLoader();
	}
}
<commit_msg>public static final -> private static final *happy*<commit_after>package plugins.Sharesite;

import plugins.Sharesite.common.Logger;
import plugins.Sharesite.webui.WebInterface;
import freenet.l10n.BaseL10n;
import freenet.l10n.PluginL10n;
import freenet.l10n.BaseL10n.LANGUAGE;
import freenet.pluginmanager.FredPlugin;
import freenet.pluginmanager.FredPluginBaseL10n;
import freenet.pluginmanager.FredPluginL10n;
import freenet.pluginmanager.FredPluginRealVersioned;
import freenet.pluginmanager.FredPluginThreadless;
import freenet.pluginmanager.FredPluginVersioned;
import freenet.pluginmanager.PluginRespirator;

import java.awt.GraphicsEnvironment;

/**
 * This is the main class, the first one executed by Freenet.
 * Only one instance exists, and can be accessed from anywhere using
 * the global variable. The most logical way to reach different things.
 */
public class Plugin implements FredPlugin, FredPluginVersioned, FredPluginRealVersioned, FredPluginL10n, FredPluginBaseL10n, FredPluginThreadless {
	private static final String version = "0.2.8";
	public static final long realVersion = 2;
	public static final String freesite = "USK@dCnkUL22fAmKbKg-Cftx9j2m4IwyWB0QbGoiq1RSLP8,4d1TDqwRr4tYlsubLrQK~c4h0~FtmE-OXCDmFiI8BB4,AQACAAE/Sharesite/-1/";
	public static boolean isPreRelease = false;

	private PluginL10n plugL10n;

	public static Plugin instance;
	public PluginRespirator pluginRespirator;
	public BaseL10n l10n;

	public Logger logger;
	public Inserter inserter;
	public Database database;
	public WebInterface webInterface;

	public Plugin() {
		instance = this;
	}

	@Override
	public void runPlugin(PluginRespirator pr) {
		pluginRespirator = pr;

		logger = new Logger("Sharesite.log");
		logger.putstr("Loading of Sharesite " + version + " begins!");

		logger.putstr("Setting GraphicsEnvironment to headless");
		System.setProperty("java.awt.headless","true");

		logger.putstr("Preparing the inserter ...");
		inserter = new Inserter();
		inserter.start();

		logger.putstr("Loading the database ...");
		database = new Database();

		logger.putstr("Registering the web interface ...");
		webInterface = new WebInterface();
		webInterface.createInterface();

		logger.putstr("Successfully started!");
	}

	@Override
	public void terminate() {
		logger.putstr("Terminating ...");
		webInterface.removeInterface();
		inserter.terminate();
		logger.close();
	}

	@Override
	public String getVersion() {
		return version;
	}

	@Override
	public long getRealVersion() {
		return realVersion;
	}

	@Override
	public String getString(String key) {
		return l10n.getString(key);
	}

	@Override
	public void setLanguage(LANGUAGE newLanguage) {
		plugL10n = new PluginL10n(this, newLanguage);
		l10n = plugL10n.getBase();
	}

	@Override
	public String getL10nFilesBasePath() {
		return "plugins/Sharesite/l10n/";
	}

	@Override
	public String getL10nFilesMask() {
		return "lang_${lang}.l10n";
	}

	@Override
	public String getL10nOverrideFilesMask() {
		return "Sharesite_lang_${lang}.override.l10n";
	}

	@Override
	public ClassLoader getPluginClassLoader() {
		return Plugin.class.getClassLoader();
	}
}

{'fraction_non_alphanumeric': 0.10036995335370757, 'fraction_numerical': 0.02251889979089593, 'mean_word_length': 5.351378958120531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1344858', 'n_tokens_mistral': 2233, 'n_tokens_neox': 2019, 'n_words': 462}