hello I am currently working on breaking down words in to word families. Bolds are the descriptions and I have to use map and set...
My question is how can I get all the word families if the length of word get larger??? and how can i put them into the map...
I am trying to make a map in a form of map<String, Set<String>> where first String is a form of word families like '----' or '-e--' and Set<String> contains words that falls into that form. I have a large lists of words and i have to test them and sort them into that form. Help !!!!
Now, suppose that the user guesses the letter ‘E’. You now need to indicate which letters in the word you've “picked” are E's. Of course, you haven't picked a word, and so you have multiple options about where you reveal the E's. Every word in the set falls into one of five “word families:”
· “- - - -”: which is the pattern for [ally, cool, good]
· “- e - -”: which is the pattern for [beta, deal]
· “- - e -”: which is the pattern for [flew, ibex]
· “e - - e”: which is the pattern for [else]
· “- - - e”: which is the pattern for [hope]
Let's see a few more examples of this strategy. Given this three-word set, if the user guesses the letter O, then you would break your word list down into two families:
· “- o o -”: containing [cool, good]
· “- - - -”: containing [ally]
The first of these families is larger than the second, and so you choose it, revealing two O's in the word and reducing your set of words to