Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pick a random english word from a list [closed]

What would be the best way to go about getting a function that returns a random English word (preferably a noun), without keeping a list of all possible words in a file before hand?

like image 852
Josh Hunt Avatar asked Feb 27 '09 10:02

Josh Hunt


People also ask

What is random word generator?

The Random Word Generator is a tool to help you create a list of random words. There are many reasons one might be interested in doing this, and you're likely here because you're interested in creating a random word list. This tool can help you do exactly that.

What is a word generator?

In a nutshell, a word generator is a tool that helps you to find words. It generates all possible words from your letters and by doing so, helps you discover new ones. People use word solvers for various reasons, but the main aim is always the same - to make words from your input letters.


1 Answers

Word lists need not take up all that much space.

Here's a JSON wordlist with 2,465 words, all nouns. It clocks in at under 50K, the size of a medium-sized jpeg image.

I'll leave choosing a random one as an exercise for the reader.

like image 108
Kenan Banks Avatar answered Sep 21 '22 13:09

Kenan Banks