How can I generate a random English "sounding" word in .Net?
I'd use a Markov chain algorithm for this.
In summary:
- Build a dictionary. Iterate through the letters in an example piece of English text. Build a data structure that maps pairs of letters. Against each pair, record a probability that the second letter appears immediately after the first.
- Generate your text. Using the map that you built in (1), pick a sequence of random letters. When deciding what letter to write next, look at the letter you wrote most recently, and use that letter to determine the probability of the next letter.
There are several things you can do:
1) Research English syllable structure, and generate syllables following those rules
2) Employ Markov chains to get a statistical model of English phonology.
There are plenty of resources on Markov chains, but the main idea is to record the probability of there being any particular letter after a certain sequence. For instance, after "q", "u" is very very likely; after "k", "q" is very very unlikely (this employs 1-length Markov chains); or, after "th", "e" is very likely (this employs 2-length Markov chains).
If you go the syllable model route, you can use resources like this to help you elucidate your intuitions about your language.
UPDATE:
3) You can make it much simpler by not simulating full English, but, say, Japanese, or Italian, where rules are much easier, and if it's a nonsense word it is as easy to remember as a nonsense English word. For instance, Japanese only has about 94 valid syllables (47 short, 47 long), and you can list all of them easily and pick at random.