I am trying to build a word-based-game application in Java. I browsed through some existing questions and got some idea how to get wordlist. Some of the questions I have referred to:
How to pick a random english word from a list
My motive is to generate a random word. After getting the wordlist downloaded as a text file, I am trying to generate a
Map<String, Integer> m = new HashMap<String, Integer>();
which could give me a word since I could query it using a random integer generated.
Is this a recommended approach or is there a better way to generate a random word from the wordlist?
Thanks.