Check this link ! It presents an easy algorithm that’s very applicable:
- input texts
- generate a letter randomly
- produce the next character according to its probability of appearance after the first letter (learned from input texts)
- once there are at least x characters, produce the next character according to the x previous ones. With longer x, the generated text makes more sense, but more it’s more similar to input texts!