This is higher order Markov chain
Depending on the type of the prior word, it randomly selects the next word from a list of compatible word types.
Am I misunderstanding?