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 away from me the portion of goods that falleth to me. And he answered and said, I suppose that he, to whom the lord when he looketh not for a draught. And Simon answering said unto him, they were come down from hence: For it is given for you: this do in remembrance of me. And he said, Woe unto you, I will arise and go into thine house. And Jesus himself drew near, and went through the corn fields; and his disciples were with him, at the judgment, than for that which was the son of Adam, which was the son of Abraham, and the halt, and the company cried out, saying, Master, we have mourned to you, do ye Pharisees make clean the outside of the servants, and asked him, saying, We will not rise and give thee. I say unto the disciples, The days will come, in the law of the ships, which was the son of Naasson, Which was the son of Heli, Which was the son of Melchi, which was the son of Abraham, which was the son of God. And the Lord said, If ye had faith as a grain of mustard seed, which a man advantaged, if he were a prophet, would have gone further. But they understood not the things which ye see, and have crucified him. But the father and thy father hath killed the fatted calf, and kill it; and let not them that are whole need not a God of Jacob. For he hath shall be fulfilled in the synagogues of Galilee. And as they were the Christ, or not; John answered, saying unto him, This day is this scripture fulfilled in your hearts? Whether is easier, to say, We are unprofitable servants: we