<commit_before>module TimeSpanner

  class TimeUnitCollector
    include TimeHelpers
    include TimeUnits

    AVAILABLE_UNITS = [:millenniums, :centuries, :decades, :years, :months, :weeks, :days, :hours, :minutes, :seconds, :milliseconds, :microseconds, :nanoseconds]

    attr_reader :from, :to, :unit_names, :duration_chain

    def initialize(from, to, unit_names)
      @from = from
      @to = to
      @duration_chain = DurationChain.new(from, to)
      @unit_names     = unit_names

      validate_unit_names!
      add_units_to_chain
    end

    def add_units_to_chain
      unit_names.each do |name|
        duration_chain << unit_by_name(name)
      end
    end

    def unit_by_name(name)
      case name
        #when :millenniums then Millenium.new
        #when :centuries then Century.new
        #when :decades then Decade.new
        #when :years then Year.new
        when :months       then Month.new
        when :weeks        then Week.new
        when :days         then Day.new
        when :hours        then Hour.new<commit_msg>remove obsolete attr_readers<commit_after>module TimeSpanner

  class TimeUnitCollector
    include TimeHelpers
    include TimeUnits

    AVAILABLE_UNITS = [:millenniums, :centuries, :decades, :years, :months, :weeks, :days, :hours, :minutes, :seconds, :milliseconds, :microseconds, :nanoseconds]

    attr_reader :unit_names, :duration_chain

    def initialize(from, to, unit_names)
      @duration_chain = DurationChain.new(from, to)
      @unit_names     = unit_names

      validate_unit_names!
      add_units_to_chain
    end

    def add_units_to_chain
      unit_names.each do |name|
        duration_chain << unit_by_name(name)
      end
    end

    def unit_by_name(name)
      case name
        #when :millenniums then Millenium.new
        #when :centuries then Century.new
        #when :decades then Decade.new
        #when :years then Year.new
        when :months       then Month.new
        when :weeks        then Week.new
        when :days         then Day.new
        when :hours        then Hour.new
{'fraction_non_alphanumeric': 0.07681228996639462, 'fraction_numerical': 0.0, 'mean_word_length': 2.5025210084033613, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7044878', 'n_tokens_mistral': 675, 'n_tokens_neox': 635, 'n_words': 171}