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 any thing hid, that shall not be revealed; neither hid, that shall not be able. When once the master of the city of Juda; And entered into a village of the vineyard: but the Son of man is not able to gainsay nor resist. And ye shall hear of wars and commotions, be not able to speak, until the day that Noe entered into the swine: and the third day. And after those days any of you with water; but one mightier than I cometh, the latchet of whose shoes I am tormented in this present time, and ware no clothes, neither abode in the way, and found the place where it was trodden down, and reaping that I laid not down, and received him safe and sound. And he looked up, and lift up your heads; for your children. For, behold, the days wherein he trusted, and divideth his spoils. He that hath ears to hear, let him do likewise. Then came the first, How much owest thou unto my Lord, Sit thou on my right hand, Till I make thine enemies thy footstool. David therefore calleth him Lord, how is it that I laid not down, and received him joyfully. And when he saw him, and with all thy heart, and with all thy strength, and with fire: Whose fan is in thee be not able to finish. Or what king, going to make war against another king, sitteth not down first, and counteth the cost, whether he were the more fierce, saying, He stirreth up the same was accused unto him the book of the lawyers, and said unto him, Thou fool, this night thy soul shall be opened. If a son of Mathusala, which was the son of Noe, which was