<commit_before>/*
 * Contains groups of units, useful constants, and methods to convert between units.
 * 
 * Author: <NAME>
 * Version: 2/5/2016
 */

package HelperClasses;

import java.util.TreeMap;

import javax.swing.JTextField;

public class Units
{
	public static final int ENTERFIELD_AMOUNT_COLUMNS = 6;
	public static final int ENTERFIELD_AMOUNT_WIDTH = ((System.getProperty("os.name").contains("Mac")) ? -6 : 0) +
			(int)(new JTextField(ENTERFIELD_AMOUNT_COLUMNS).getPreferredSize().getWidth());
	public static final int ENTERFIELD_AMOUNT_HEIGHT = 26 + ((System.getProperty("os.name").contains("Mac")) ? 6 : 0);
	public static final double R = .0821, STANDARD_PRESSURE = 1, STANDARD_TEMPERATURE = 273.15, C = 3E8, h = 6.626E-34;
	public static final int UNKNOWN_VALUE = -500, ERROR_VALUE = -501;
	public static final String[] PREFIXES = {"p", "n", "\u00B5", "m", "c", "d", "", "da", "h", "k", "M", "T", "G"};
	public static final int[] POWERS = {-12, -9, -6, -3, -2, -1, 0, 1, 2, 3, 6, 9, 12};
	private static final TreeMap<String, String[]> UNITS = generateMap();
	
	private static TreeMap<String, String[]> generateMap()
	{
		TreeMap<String, String[]> units = new TreeMap<String, String[]>();
		units.put("Pressure", new String[]{"atm", "torr", "kPa"});
		units.put("Temperature", new String[]{"K", "\u2103", "\u2109"});
		units.put("Amount", new String[]{"mol"});
		units.put("Volume", createGroup("L"));
		units.put("Length", createGroup("m"));
		units.put("Mass", createGroup("g"));
		units.put("Frequency", new String[]{"Hz"});
		units.put("Energy", new String[]{"J"});
		units.put("Velocity", new String[] {"m/s"});
		units.put("Planck", new String[]{"J\u00B7s"});
		units.put("Time", new String[]{"s", "hr", "day"});
		units.put("Mass*Temp", new String[]{"g\u00B7K", "g\u00B7\u2103"});
		units.put("Percent", new String[]{"%"});
		return units;
	}
	
	private static String[] createGroup(String base)
	{
		String[] group = new String[PREFIXES.length];
		for(int index = 0; index < PREFIXES.length; index++)
		{<commit_msg>Fixed Julia's Stupid Mistake<commit_after>/*
 * Contains groups of units, useful constants, and methods to convert between units.
 * 
 * Author: <NAME>
 * Version: 2/5/2016
 */

package HelperClasses;

import java.util.TreeMap;

import javax.swing.JTextField;

public class Units
{
	public static final int ENTERFIELD_AMOUNT_COLUMNS = 6;
	public static final int ENTERFIELD_AMOUNT_WIDTH = ((System.getProperty("os.name").contains("Mac")) ? -6 : 0) +
			(int)(new JTextField(ENTERFIELD_AMOUNT_COLUMNS).getPreferredSize().getWidth());
	public static final int ENTERFIELD_AMOUNT_HEIGHT = 26 + ((System.getProperty("os.name").contains("Mac")) ? 6 : 0);
	public static final double R = .0821, STANDARD_PRESSURE = 1, STANDARD_TEMPERATURE = 273.15, C = 3E8, h = 6.626E-34;
	public static final int UNKNOWN_VALUE = -500, ERROR_VALUE = -501;
	public static final String[] PREFIXES = {"p", "n", "\u00B5", "m", "c", "d", "", "da", "h", "k", "M", "G", "T"};
	public static final int[] POWERS = {-12, -9, -6, -3, -2, -1, 0, 1, 2, 3, 6, 9, 12};
	private static final TreeMap<String, String[]> UNITS = generateMap();
	
	private static TreeMap<String, String[]> generateMap()
	{
		TreeMap<String, String[]> units = new TreeMap<String, String[]>();
		units.put("Pressure", new String[]{"atm", "torr", "kPa"});
		units.put("Temperature", new String[]{"K", "\u2103", "\u2109"});
		units.put("Amount", new String[]{"mol"});
		units.put("Volume", createGroup("L"));
		units.put("Length", createGroup("m"));
		units.put("Mass", createGroup("g"));
		units.put("Frequency", new String[]{"Hz"});
		units.put("Energy", new String[]{"J"});
		units.put("Velocity", new String[] {"m/s"});
		units.put("Planck", new String[]{"J\u00B7s"});
		units.put("Time", new String[]{"s", "hr", "day"});
		units.put("Mass*Temp", new String[]{"g\u00B7K", "g\u00B7\u2103"});
		units.put("Percent", new String[]{"%"});
		return units;
	}
	
	private static String[] createGroup(String base)
	{
		String[] group = new String[PREFIXES.length];
		for(int index = 0; index < PREFIXES.length; index++)
		{
{'fraction_non_alphanumeric': 0.20547275836794526, 'fraction_numerical': 0.037625213779623745, 'mean_word_length': 5.002932551319648, 'pattern_counts': {'":': 0, '<': 15, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '333703', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1438, 'n_words': 377}