<commit_before>/*
 * SoundgatesConfig.cpp
 *
 *  Created on: 10.12.2013
 *      Author: gwue
 */

#include "SoundgatesConfig.hpp"

SoundgatesConfig* SoundgatesConfig::instance = 0;

SoundgatesConfig* SoundgatesConfig::getInstance()
{
	if (instance == 0)
	{
		instance = new SoundgatesConfig();
	}
	return instance;
}

SoundgatesConfig::SoundgatesConfig()
{
	this->initialized = false;
	this->cfgPath = "";

}

double SoundgatesConfig::getConf(SoundgatesConfValue v)
{
	if (!initialized)
	{
		std::cerr << "Configuration was not initialized before reading!"
				<< std::endl;
	}

	return configValues[v];
}

void SoundgatesConfig::load(string path)
{
	//TODO NOT YET IMPLEMENTED
	throw 0;<commit_msg>Load defaults when trying to access configuration values before initialization<commit_after>/*
 * SoundgatesConfig.cpp
 *
 *  Created on: 10.12.2013
 *      Author: gwue
 */

#include "SoundgatesConfig.hpp"

SoundgatesConfig* SoundgatesConfig::instance = 0;

SoundgatesConfig* SoundgatesConfig::getInstance()
{
	if (instance == 0)
	{
		instance = new SoundgatesConfig();
	}
	return instance;
}

SoundgatesConfig::SoundgatesConfig()
{
	this->initialized = false;
	this->cfgPath = "";

}

double SoundgatesConfig::getConf(SoundgatesConfValue v)
{
	if (!initialized)
	{
		std::cerr << "Configuration was not initialized before reading! Using defaults"
				<< std::endl;
		this->loadDefault();
	}

	return configValues[v];
}

void SoundgatesConfig::load(string path)
{
	//TODO NOT YET IMPLEMENTED
	throw 0;
{'fraction_non_alphanumeric': 0.12724850099933377, 'fraction_numerical': 0.014656895403064623, 'mean_word_length': 4.776923076923077, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 8, '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': '2268704', 'n_tokens_mistral': 537, 'n_tokens_neox': 510, 'n_words': 111}