This Ruby method searches a string parameter and counts occurrences of words from a dictionary parameter
(String, Array)
Hash
Create a method that accepts a string and a dictionary array, then counts each occurrence of every word of the dictionary in the passed string
Ruby arrays, hashes, regex, and string methods
- How to use regex to find exact matches in a string
- How to count the number of regex matches
- How to iterate over an array
- How to initialise a hash
- How to add data to a hash
- How to change the values of a hash