<commit_before>#!/usr/bin/env ruby

class Formula
  attr_accessor :flours, :liquids, :additives
  def initialize
    @flours    = Hash.new(0)
    @liquids   = Hash.new(0)
    @additives = Hash.new(0)
  end

end

class Recipe
  attr_accessor :flours, :liquids, :additives
  def initialize 
    @flours    = Hash.new(0)
    @liquids   = Hash.new(0)
    @additives = Hash.new(0)
  end

  def percent_100
    @flours.map{|k,v| v}.inject(:+).to_f
  end

  def bp item
    item / percent_100 * 100
  end
end

<commit_msg>tidy method name bakers_100_percent<commit_after>#!/usr/bin/env ruby

class Formula
  attr_accessor :flours, :liquids, :additives
  def initialize
    @flours    = Hash.new(0)
    @liquids   = Hash.new(0)
    @additives = Hash.new(0)
  end

end

class Recipe
  attr_accessor :flours, :liquids, :additives
  def initialize 
    @flours    = Hash.new(0)
    @liquids   = Hash.new(0)
    @additives = Hash.new(0)
  end

  def bakers_100_percent
    @flours.map{|k,v| v}.inject(:+).to_f
  end

  def ingredients
    [@flours, @liquids, @additives]
  end

  def bp item
    item / bakers_100_percent * 100
  end

  def weight
    self.ingredients.each.map{|k,v| v}.inject(:+).to_f
  end


end


{'fraction_non_alphanumeric': 0.12209302325581395, 'fraction_numerical': 0.027408637873754152, 'mean_word_length': 2.8621794871794872, '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': '3698598', 'n_tokens_mistral': 529, 'n_tokens_neox': 473, 'n_words': 106}