<commit_before>package com.github.aureliano.achmed;

import java.util.Locale;

import org.apache.log4j.Logger;

import com.github.aureliano.achmed.idiom.LanguageCode;
import com.github.aureliano.achmed.idiom.LanguageSingleton;

public final class AppConfiguration {

	private static final Logger logger = Logger.getLogger(AppConfiguration.class);
	
	private LanguageCode language;
	
	public AppConfiguration() {
		this.applyConfiguration();
	}
	
	public void applyConfiguration() {
		logger.info("Apply core configuration.");
		this.configureLocale();
		LanguageSingleton.instance().setDefaultLanguageCode(this.language);
	}
	
	public LanguageCode getLanguage() {
		return language;
	}
	
	private void configureLocale() {
		logger.info("Configuring default locale.");
		
		Locale locale = Locale.getDefault();
		String code = locale.getLanguage() + "_" + locale.getCountry();
		
		logger.info(String.format(
				"Using default locale to %s with language %s (%s).",
				locale.getDisplayCountry(),
				locale.getDisplayLanguage(),
				code
			)
		);
		
		this.language = LanguageCode.valueOf(code.toUpperCase());
	}
}<commit_msg>Configure operating system resolver.<commit_after>package com.github.aureliano.achmed;

import java.util.Locale;

import org.apache.log4j.Logger;

import com.github.aureliano.achmed.idiom.LanguageCode;
import com.github.aureliano.achmed.idiom.LanguageSingleton;
import com.github.aureliano.achmed.os.IOperatingSystem;
import com.github.aureliano.achmed.os.OperatingSystemFactory;

public final class AppConfiguration {

	private static final Logger logger = Logger.getLogger(AppConfiguration.class);
	
	private LanguageCode language;
	private IOperatingSystem operatingSystem;
	
	public AppConfiguration() {
		this.applyConfiguration();
	}
	
	public void applyConfiguration() {
		logger.info("Apply core configuration.");
		
		this.configureLocale();
		LanguageSingleton.instance().setDefaultLanguageCode(this.language);
		
		this.resolveOperatingSystem();
	}
	
	public LanguageCode getLanguage() {
		return language;
	}
	
	public IOperatingSystem getOperatingSystem() {
		return operatingSystem;
	}
	
	private void resolveOperatingSystem() {
		logger.info("Resolve operating system.");
		
		this.operatingSystem = OperatingSystemFactory.currentOperatingSystem();
		logger.info("Operating System: " + this.operatingSystem.getOperatingSystem());
		logger.info("Operating System family: " + this.operatingSystem.getOperatingSystemFamily());
	}
	
	private void configureLocale() {
		logger.info("Configuring default locale.");
		
		Locale locale = Locale.getDefault();
		String code = locale.getLanguage() + "_" + locale.getCountry();
		
		logger.info(String.format(
				"Using default locale to %s with language %s (%s).",
				locale.getDisplayCountry(),
				locale.getDisplayLanguage(),
				code
			)
		);
		
		this.language = LanguageCode.valueOf(code.toUpperCase());
	}
}
{'fraction_non_alphanumeric': 0.11310344827586206, 'fraction_numerical': 0.000689655172413793, 'mean_word_length': 4.8843813387423936, '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': '7486874', 'n_tokens_mistral': 925, 'n_tokens_neox': 808, 'n_words': 165}