You want to build a word cloud, an infographic where the size of a word corresponds to how often it appears in the body of text. For example, if we turn the Gettysburg Address into a word cloud, it might look like this.
To do this, you'll need data!
Write code that takes a long string and builds its word cloud data into a hash (or JSON object), where the keys are the words and the values are the number of times the words occurred.
Think about capitalized words. For example, look at these sentences:
"After beating the eggs, Dana read the next step:"
"Add milk and eggs, then add flour and sugar."
What do we want to do with "After", "Dana", and "add"?
In this example, your final hash should include one "Add" or "add" with a value of 2
. Make reasonable (not necessarily perfect) decisions about cases like "After" and "Dana".