Guest User

Untitled

a guest
Sep 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. class String
  2. def
  3. word_count
  4. frequencies = Hash.new(0)
  5. downcase.scan(/\w+/) { | word | frequencies[word] += 1}
  6. return frequencies
  7. end
  8. end
Add Comment
Please, Sign In to add comment