Hello, i'd be grateful is somebody could help me understand this bit of code!
words = text.split(" ")
frequencies = Hash.new(0)
words.each do | word |
frequencies[word] += 1
I don't quite understand what you are doing with frequencies
A. To begin with by setting Hash.new(0)
B. What we are accomplishing later by adding frequencies[word] += 1
It's completely lost on me in the text used on the tutorial and it would be extremely helpful is someone could explain it to me in a different way.