<commit_before>'use strict';

// loadingScreen.js: display a loading screen and launch the Siad API
// if an available daemon is not running on the host,
// launch an instance of siad using config.js.

const remote = require('electron').remote;
const Siad = require('sia.js');
const Path = require('path');
var config = remote.require('./js/mainjs/config.js')(Path.resolve('config.json'));
config.path = Path.resolve('Sia');
const overlay = document.getElementsByClassName('overlay')[0];
const overlayText = overlay.getElementsByClassName('centered')[0].getElementsByTagName('p')[0];

const showError = function(error) {
	overlayText.textContent = 'A Sia-UI error has occured: ' + error;
};

// startUI starts a Sia UI instance using the given welcome message.
// calls initUI() on after displaying a welcome message
const startUI = function(welcomemsg, initUI) {
	// Display a welcome message, then initialize the ui
	overlayText.innerHTML = welcomemsg;
	initUI();
	overlay.style.display = 'none';
};

// startSiad configures and starts a Siad instance.
// callback is called on successful start.
const startSiad = function(callback) {
	Siad.configure(config, function(error) {<commit_msg>comment typo<commit_after>'use strict';

// loadingScreen.js: display a loading screen and launch the Siad API
// if an available daemon is not running on the host,
// launch an instance of siad using config.js.

const remote = require('electron').remote;
const Siad = require('sia.js');
const Path = require('path');
var config = remote.require('./js/mainjs/config.js')(Path.resolve('config.json'));
config.path = Path.resolve('Sia');
const overlay = document.getElementsByClassName('overlay')[0];
const overlayText = overlay.getElementsByClassName('centered')[0].getElementsByTagName('p')[0];

const showError = function(error) {
	overlayText.textContent = 'A Sia-UI error has occured: ' + error;
};

// startUI starts a Sia UI instance using the given welcome message.
// calls initUI() after displaying a welcome message.
const startUI = function(welcomemsg, initUI) {
	// Display a welcome message, then initialize the ui
	overlayText.innerHTML = welcomemsg;
	initUI();
	overlay.style.display = 'none';
};

// startSiad configures and starts a Siad instance.
// callback is called on successful start.
const startSiad = function(callback) {
	Siad.configure(config, function(error) {
{'fraction_non_alphanumeric': 0.12578880942364326, 'fraction_numerical': 0.002524190155658393, 'mean_word_length': 5.066326530612245, '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': '5977112', 'n_tokens_mistral': 699, 'n_tokens_neox': 686, 'n_words': 226}