I'll implement a method #substrings that takes a word as the first argument and then an array of valid substrings (your dictionary) as the second argument.
It will return a hash listing each substring (case insensitive) that was found in the original string and how many times it was found.