<commit_before>/*
 * Copyright (c) 2013 Codearte
 */
package eu.codearte.fairyland;

import com.google.inject.Guice;
import com.google.inject.Injector;
import eu.codearte.fairyland.producer.Company;
import eu.codearte.fairyland.producer.person.NationalIdentificationNumber;
import eu.codearte.fairyland.producer.person.NationalIdentityCardNumber;
import eu.codearte.fairyland.producer.person.Person;
import eu.codearte.fairyland.producer.person.Sex;
import eu.codearte.fairyland.producer.text.FairUtil;
import eu.codearte.fairyland.producer.text.Text;
import eu.codearte.fairyland.producer.util.DateGenerator;
import eu.codearte.fairyland.producer.util.RandomGenerator;
import eu.codearte.fairyland.producer.util.TimeProvider;
import org.joda.time.DateTime;

import java.io.IOException;
import java.util.Locale;

/**
 * Entry class
 */
public final class Fairy {

	private static final String DATA_FILE_PREFIX = "fairyland_";
	private final Injector injector;

	private Fairy(Locale locale, String filePrefix) {
		injector = Guice.createInjector(new FairyModule());

		try {
			DataMaster dataMaster = injector.getInstance(DataMaster.class);
			dataMaster.readResources(filePrefix + locale.getLanguage() + ".yml");
		} catch (IOException e) {
			throw new IllegalStateException(e);
		}

//    pico.as(Characteristics.CACHE).addComponent(dataMaster);
//    pico.addComponent(randomGenerator);
//    pico.addComponent(FairUtil.class);
//    pico.addComponent(TimeProvider.class);
//    pico.addComponent(DateGenerator.class);
//    pico.addComponent(RandomDataGenerator.class);
//    pico.addComponent(Text.class);
//    pico.addComponent(TextProducer.class);
//    pico.addComponent(Person.class).as(Characteristics.CACHE);
//    pico.addComponent(NationalIdentificationNumber.class, Pesel.class);
//    pico.addComponent(NationalIdentityCardNumber.class, PolishIdentityCardNumber.class);
//    pico.addComponent(VATIdentificationNumber.class, NIP.class);
//    pico.as(Characteristics.NO_CACHE).addComponent(Company.class);
	}

	/**
	 * Use this factory method to create dataset containing default fairyland_{langCode}.yml files
	 * merged with custom files with the same name
	 *
	 * @return Fairy instance
	 */
	public static Fairy create() {
		return create(Locale.ENGLISH);
	}

	/**
	 * Use this factory method to create dataset containing default fairyland_{langCode}.yml files
	 * merged with custom files with the same name
	 *
	 * @param locale will be used to assess langCode for data file
	 * @return Fairy instance
	 */
	public static Fairy create(Locale locale) {
		return create(locale, DATA_FILE_PREFIX);<commit_msg>Removed old commits<commit_after>/*
 * Copyright (c) 2013 Codearte
 */
package eu.codearte.fairyland;

import com.google.inject.Guice;
import com.google.inject.Injector;
import eu.codearte.fairyland.producer.Company;
import eu.codearte.fairyland.producer.person.NationalIdentificationNumber;
import eu.codearte.fairyland.producer.person.NationalIdentityCardNumber;
import eu.codearte.fairyland.producer.person.Person;
import eu.codearte.fairyland.producer.person.Sex;
import eu.codearte.fairyland.producer.text.FairUtil;
import eu.codearte.fairyland.producer.text.Text;
import eu.codearte.fairyland.producer.util.DateGenerator;
import eu.codearte.fairyland.producer.util.RandomGenerator;
import eu.codearte.fairyland.producer.util.TimeProvider;
import org.joda.time.DateTime;

import java.io.IOException;
import java.util.Locale;

/**
 * Entry class
 */
public final class Fairy {

	private static final String DATA_FILE_PREFIX = "fairyland_";
	private final Injector injector;

	private Fairy(Locale locale, String filePrefix) {
		injector = Guice.createInjector(new FairyModule());

		try {
			DataMaster dataMaster = injector.getInstance(DataMaster.class);
			dataMaster.readResources(filePrefix + locale.getLanguage() + ".yml");
		} catch (IOException e) {
			throw new IllegalStateException(e);
		}

	}

	/**
	 * Use this factory method to create dataset containing default fairyland_{langCode}.yml files
	 * merged with custom files with the same name
	 *
	 * @return Fairy instance
	 */
	public static Fairy create() {
		return create(Locale.ENGLISH);
	}

	/**
	 * Use this factory method to create dataset containing default fairyland_{langCode}.yml files
	 * merged with custom files with the same name
	 *
	 * @param locale will be used to assess langCode for data file
	 * @return Fairy instance
	 */
	public static Fairy create(Locale locale) {
		return create(locale, DATA_FILE_PREFIX);
{'fraction_non_alphanumeric': 0.10487966438507397, 'fraction_numerical': 0.0017663943475380878, 'mean_word_length': 4.867875647668394, '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': '520686', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1325, 'n_words': 303}