<commit_before>module Configus
  class Config < Hash

    def method_missing(method_name, *args, &block)
      if block_given?
        self[method_name] = Config.new
        self[method_name].instance_eval(&block)
      end

      if self.has_key?(method_name)
        self[method_name]
      else
        self[method_name] = args.first
      end
    end

=begin
    def deep_merge(other_hash)
      self.merge(other_hash) do |key, oldval, newval|
        oldval = oldval.to_hash if oldval.respond_to?(:to_hash)
        newval = newval.to_hash if newval.respond_to?(:to_hash)
        if oldval.class.to_s == 'Hash' && newval.class.to_s == 'Hash'
          Config[oldval].deep_merge(Config[newval])
        else
          newval
        end
      end
    end
=end

    def deep_merge(src_hash, other_hash)
      src_hash.merge(other_hash) do |key, oldval, newval|
        #if oldval.class.to_s == 'Hash' && newval.class.to_s == 'Hash'
        if oldval.is_a?(Hash) && newval.is_a?(Hash)
          deep_merge(oldval, newval)
        else
          newval
        end
      end
    end

  end
end<commit_msg>Config modified<commit_after>module Configus
  class Config < Hash

    def method_missing(method_name, *args, &block)
      if block_given?
        self[method_name] = Config.new
        self[method_name].instance_eval(&block)
      end

      if self.has_key?(method_name)
        self[method_name]
      else
        self[method_name] = args.first
      end
    end

  end
end
{'fraction_non_alphanumeric': 0.09838274932614555, 'fraction_numerical': 0.0, 'mean_word_length': 2.307349665924276, 'pattern_counts': {'":': 0, '<': 5, '<?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': '623209', 'n_tokens_mistral': 507, 'n_tokens_neox': 501, 'n_words': 101}