def alliterativity
      words = self.downcase.gsub(/[^a-z\s]/, '').split
      leading_letters = words.map(&:chr)
      
      # { 'a' => 3, 'b' => 1, ... }
      leading_letter_counts = leading_letters.inject({}) do |result, letter|
        result[letter] ||= 0
        result[letter] += 1
        result
      end
      
      most_used_count = leading_letter_counts.max_by { |kv| kv.last }.pop
      most_used_count.to_f / words.length
    end
def alliterativity
      words = self.downcase.gsub(/[^a-z\s]/, '').split
      leading_letters = words.map(&:chr)
      
      # { 'a' => 3, 'b' => 1, ... }
      leading_letter_counts = leading_letters.inject({}) do |result, letter|
        result[letter] ||= 0
        result[letter] += 1
        result
      end
      
      most_used_count = leading_letter_counts.max_by { |kv| kv.last }.pop
      most_used_count.to_f / words.length
    end
A score between 0 and 1 representing the level of alliteration