<commit_before>require_relative 'units_mixin'
require_relative 'units/literal.rb'

# Add an exception class for unsupported operations
class UnitsError < ArgumentError
end

class Units
    attr_reader :units	# Returns the units hash

    PREFIXES = {
	:yocto => -24,	:zepto => -21,	:atto  => -18,	:femto => -15,
	:pico  => -12,	:nano  =>  -9,	:micro =>  -6,	:milli =>  -3,
	:centi =>  -2,	:deci  =>  -1,	:deca  =>   1,	:hecto =>   2,
	:kilo  =>   3,	:mega  =>   6,	:giga  =>   9,	:tera  =>  12,
	:peta  =>  15,	:exa   =>  18,	:zetta =>  21,	:yotta =>  24,
    }

    # http://en.wikipedia.org/wiki/International_System_of_Units
    SI_UNITS = [:meter, :gram, :second, :ampere, :kelvin, :candela, :mole]
    SI_DERIVED = [
	:hertz,	:radian,    :steradian,	:newton,    :pascal,	:joule,
	:watt,	:coulomb,   :volt,	:farad,	    :ohm,	:siemens,
	:weber,	:tesla,	    :henry,	:celsius,   :lumen,	:lux,
	:gray,	:sievert,   :katal,	:becquerel
    ]

    # http://en.wikipedia.org/wiki/United_States_customary_units
    US_CUSTOMARY_AREA_UNITS = [:acre, :section, :township]
    US_CUSTOMARY_INTERNATIONAL_UNITS = [:point, :pica, :inch, :foot, :yard, :mile]
    US_CUSTOMARY_MASS_UNITS = [
	:grain, :dram, :ounce, :pound, :hundredweight, :long_hundredweight,
	:short_ton, :long_ton, :pennyweight, :troy_ounce, :troy_pound
    ]
    US_CUSTOMARY_NAUTICAL_UNITS = [:fathom, :cable, :nautical_mile]
    US_CUSTOMARY_SURVEY_UNITS = [
	:link, :survey_foot, :rod, :chain,
	:furlong, :statute_mile, :league
    ]
    US_CUSTOMARY_TEMPERATURE_UNITS = [:fahrenheit, :rankine]
    US_CUSTOMARY_VOLUME_UNITS = [
	:acre_foot, :minim, :fluid_dram, :teaspoon, :tablespoon, :fluid_ounce,
	:jigger, :gill, :cup, :pint, :quart, :barrel, :hogshead
    ]
    US_CUSTOMARY_UNITS = US_CUSTOMARY_AREA_UNITS +
			 US_CUSTOMARY_INTERNATIONAL_UNITS +
			 US_CUSTOMARY_MASS_UNITS +
			 US_CUSTOMARY_NAUTICAL_UNITS +
			 US_CUSTOMARY_SURVEY_UNITS +
			 US_CUSTOMARY_TEMPERATURE_UNITS +
			 US_CUSTOMARY_VOLUME_UNITS

    ABBREVIATIONS = {
	:mm => 'millimeter', :cm => 'centimeter', :km => 'kilometer',
    }
    ABBREVIATION_EXP = Regexp.new('\A(?<abbreviation>' + ABBREVIATIONS.keys.join('|') + ')')
<commit_msg>Trivial cleaning<commit_after>require_relative 'units_mixin'
require_relative 'units/literal.rb'

# Add an exception class for unsupported operations
UnitsError = Class.new(ArgumentError)

class Units
    attr_reader :units	# Returns the units hash

    # http://wikipedia.org/wiki/Metric_prefix
    PREFIXES = {
	:yocto => -24,	:zepto => -21,	:atto  => -18,	:femto => -15,
	:pico  => -12,	:nano  =>  -9,	:micro =>  -6,	:milli =>  -3,
	:centi =>  -2,	:deci  =>  -1,	:deca  =>   1,	:hecto =>   2,
	:kilo  =>   3,	:mega  =>   6,	:giga  =>   9,	:tera  =>  12,
	:peta  =>  15,	:exa   =>  18,	:zetta =>  21,	:yotta =>  24,
    }

    # http://wikipedia.org/wiki/International_System_of_Units
    SI_UNITS = [:meter, :gram, :second, :ampere, :kelvin, :candela, :mole]
    SI_DERIVED = [
	:hertz,	:radian,    :steradian,	:newton,    :pascal,	:joule,
	:watt,	:coulomb,   :volt,	:farad,	    :ohm,	:siemens,
	:weber,	:tesla,	    :henry,	:celsius,   :lumen,	:lux,
	:gray,	:sievert,   :katal,	:becquerel
    ]

    # http://wikipedia.org/wiki/United_States_customary_units
    US_CUSTOMARY_AREA_UNITS = [:acre, :section, :township]
    US_CUSTOMARY_INTERNATIONAL_UNITS = [:point, :pica, :inch, :foot, :yard, :mile]
    US_CUSTOMARY_MASS_UNITS = [
	:grain, :dram, :ounce, :pound, :hundredweight, :long_hundredweight,
	:short_ton, :long_ton, :pennyweight, :troy_ounce, :troy_pound
    ]
    US_CUSTOMARY_NAUTICAL_UNITS = [:fathom, :cable, :nautical_mile]
    US_CUSTOMARY_SURVEY_UNITS = [
	:link, :survey_foot, :rod, :chain,
	:furlong, :statute_mile, :league
    ]
    US_CUSTOMARY_TEMPERATURE_UNITS = [:fahrenheit, :rankine]
    US_CUSTOMARY_VOLUME_UNITS = [
	:acre_foot, :minim, :fluid_dram, :teaspoon, :tablespoon, :fluid_ounce,
	:jigger, :gill, :cup, :pint, :quart, :barrel, :hogshead
    ]
    US_CUSTOMARY_UNITS = US_CUSTOMARY_AREA_UNITS +
			 US_CUSTOMARY_INTERNATIONAL_UNITS +
			 US_CUSTOMARY_MASS_UNITS +
			 US_CUSTOMARY_NAUTICAL_UNITS +
			 US_CUSTOMARY_SURVEY_UNITS +
			 US_CUSTOMARY_TEMPERATURE_UNITS +
			 US_CUSTOMARY_VOLUME_UNITS

    ABBREVIATIONS = {
	:mm => 'millimeter', :cm => 'centimeter', :km => 'kilometer',
    }
    ABBREVIATION_EXP = Regexp.new('\A(?<abbreviation>' + ABBREVIATIONS.keys.join('|') + ')')

{'fraction_non_alphanumeric': 0.1561219845243514, 'fraction_numerical': 0.013654984069185253, 'mean_word_length': 3.9051339285714284, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 51, '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': '1717892', 'n_tokens_mistral': 2074, 'n_tokens_neox': 1953, 'n_words': 334}