<commit_before>module Mom
  module Assignment
    def initialize(ingredients={})
      load ingredients if ingredients.is_a? Hash
    end
    
    def load(ingredients)
      ingredients.each { |k,v| write_ingredient(k,v) }
    end
    
    def read_ingredient(ingr)
      respond_to?(ingr) ? public_send(ingr) : instance_variable_get(:"@#{ingr}")
    end
  
    def write_ingredient(ingr, value)
      if respond_to?(:"#{ingr}=")
        public_send(:"#{ingr}=", value)
      else
        instance_variable_set(:"@#{ingr}", value)
      end
    end

    alias_method :[],  :read_ingredient
    alias_method :[]=, :write_ingredient
  end
end<commit_msg>rename write and read to set and get<commit_after>module Mom
  module Assignment
    def initialize(ingredients={})
      load ingredients if ingredients.is_a? Hash
    end
    
    def load(ingredients)
      ingredients.each { |k,v| set_ingredient(k,v) }
    end
    
    def get_ingredient(ingr)
      respond_to?(ingr) ? public_send(ingr) : instance_variable_get(:"@#{ingr}")
    end
  
    def set_ingredient(ingr, value)
      if respond_to?(:"#{ingr}=")
        public_send(:"#{ingr}=", value)
      else
        instance_variable_set(:"@#{ingr}", value)
      end
    end
    
    def ingredients
      @__ingredients ||= {}
    end

    alias_method :[],  :get_ingredient
    alias_method :[]=, :set_ingredient
  end
end
{'fraction_non_alphanumeric': 0.12445730824891461, 'fraction_numerical': 0.0, 'mean_word_length': 2.917847025495751, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7122144', 'n_tokens_mistral': 481, 'n_tokens_neox': 494, 'n_words': 94}