Babble

This was originally a project for a data structures and algorithms course.

Input a reasonably long chunk of text and press Babble to get your result. The aim of this simple program is to produce an output that makes semi-grammatical sense at first glance, but doesn't make much logical sense when you actually try reading it. More text is always better; use at least a paragraph for best results. Song lyrics can often produce amusing results.

The "Babbliness" factor determines how closely the output will match the input. Output with a Babbliness value of 5 will not resemble the input very much at all and will probably not make much grammatical sense, while output with a Babbliness value of 1 will make good grammatical sense but possibly be nearly identical to the input text.


Sample inputs: Green Eggs and Ham   Goldilocks and the Three Bears   Still Alive   Declaration of Independence   Gospel of Luke   Romeo and Juliet   



Babbliness:    Output length:   

Forasmuch as many have taken in hand to the place, came and touched him, saying, Master, master, we perish. Then he took it, and gave them to preach the acceptable year of the Jews: who also himself waited for the Son of man. They did eat, they drank, they bought, they sold, they planted, they builded; But the days shall come to destroy men???s lives, but to save that which was the son of Matthat, which was from Jerusalem about threescore furlongs. And they were given in marriage: But they understood not the burdens with one of your fathers: for they indeed killed them, and spake of him went forth to be drunken; The lord of the hall, and were set down together, Peter sat down with them, Saying, The Son of man shall not receive the word with joy; and these have no more worthy to come unto me, and see; for a draught. And Simon answering said unto him, Master, speak to the city called Nain; and many shall rejoice at his saying, and cast into the hands of men. But they understood none of them should be as they led him away, they laid hold upon one Simon, a Cyrenian, coming out of him. And the soldiers also mocked him, and passed through the midst of it depart out; and let us kill him, that he went up into a mountain to pray, as John also taught his disciples. And he taught daily in the resurrection of the Son of man also died, and was driven of the twelve. And he arose, and rebuked the wind and the third time, Why, what evil hath he done? I have somewhat to say within themselves, Who is this to me, that the kingdom of God is nigh at hand.