<commit_before>/** 
 * Copyright (c) 2015, <NAME>. All rights reserved.
 * License terms are in the included LICENSE.txt file.
 */
package engine.parsing;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

/**
 * Loads and parses a configuration file.
 * 
 * @author <NAME> (<EMAIL>)
 */
public class Config {
	private Map<String, String> map;

	/**
	 * Loads and parses a configuration file.
	 * 
	 * @param fileName
	 *            The name and path to the configuration file.
	 * @throws FileNotFoundException
	 *             If the file cannot be found.
	 * @throws IOException
	 *             If the file cannot be loaded.
	 * @throws ParseException
	 *             If the file cannot be properly parsed.
	 */
	public Config(String fileName) throws FileNotFoundException, IOException,
			ParseException {
		map = new HashMap<String, String>();
		try (BufferedReader br = new BufferedReader(new FileReader(fileName))) {
			String line;
			int lineNumber = 0;
			while ((line = br.readLine()) != null) {
				lineNumber++;
				if (line.isEmpty()) {
					continue;
				}

				char start = line.charAt(0);
				if (start == '[' || start == '#') {
					continue;
				}
				String[] tokens = line.split("=");
				if (tokens.length != 2) {
					throw new ParseException("Line has too many '=' (line "
							+ lineNumber + ")", lineNumber);
				}

				map.put(tokens[0].trim(), tokens[1].trim());
			}
		}<commit_msg>Update Config.java<commit_after>/** 
 * Copyright (c) 2015, <NAME>. All rights reserved.
 * License terms are in the included LICENSE.txt file.
 */
package engine.parsing;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

/**
 * Loads and parses a configuration file.
 * 
 * @author <NAME> (<EMAIL>)
 */
public class Config {
	private Map<String, String> map;

	/**
	 * Loads and parses a configuration file.
	 * 
	 * @param fileName
	 *            The name and path to the configuration file.
	 * @throws FileNotFoundException
	 *             If the file cannot be found.
	 * @throws IOException
	 *             If the file cannot be loaded.
	 * @throws ParseException
	 *             If the file cannot be properly parsed.
	 */
	public Config(String fileName) throws FileNotFoundException, IOException,
			ParseException {
		map = new HashMap<String, String>();
		try (BufferedReader br = new BufferedReader(new FileReader(fileName))) {
			String line;
			int lineNumber = 0;
			while ((line = br.readLine()) != null) {
				lineNumber++;
				if (line.isEmpty()) {
					continue;
				}

				char start = line.charAt(0);
				if (start == '[' || start == '#') {
					continue;
				}
				String[] tokens = line.split("=");
				if (tokens.length != 2) {
					throw new ParseException("Only one '=' expected (line "
							+ lineNumber + ")", lineNumber);
				}

				map.put(tokens[0].trim(), tokens[1].trim());
			}
		}
{'fraction_non_alphanumeric': 0.1286011286011286, 'fraction_numerical': 0.005346005346005346, 'mean_word_length': 3.01909307875895, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4644837', 'n_tokens_mistral': 1145, 'n_tokens_neox': 981, 'n_words': 308}