it's a bit more complicated then that. Essentially, for each word in the dictionary, you have a table of probabilties for every other adjacent word in your dataset. Then you pick a starting word (prompt) and walk forwards and backwards through the table, picking the next word(s) based on their probabilities