This software reads text and generates new ones based on statistics.
I also have an older version of it written in processing, quicker but less subtle.
Here is also an exemple xml file with it.