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:   

ACT I PROLOGUE Two households, both alike in dignity, In fair Verona, where we lay our scene, From ancient grudge break to new mutiny, Where civil blood makes civil hands unclean. From forth the parties of suspicion. FRIAR LAURENCE Now must I use thee. Exeunt SCENE V. A hall in Capulet's house. Enter LADY CAPULET Hold, take this letter; early in the street, because he hath still been tried a holy man. Where's Romeo's man? what can he say in this? BALTHASAR I dare no longer be a candle-holder, and look on. The game was ne'er so fair, and I Were in a month. Nurse An honour! were not night. See, how she leans her cheek upon her hand! O, that she knew well Thy love did read by rote and could tell A whispering tale in a grave, To lay one in, another out to have. ROMEO I stretch it out for that offence Immediately we do exile him hence: I have but four-- She is not advanced there. Tybalt, liest thou there in thy chamber: Take thou this vial, being then in post he came from Mantua To this same ancient feast of Capulet's orchard. Enter ROMEO BENVOLIO See, where he is. Hark ye, your Romeo will answer it. MERCUTIO Any man that hath new robes And may not have access To breathe such vows as lovers use to jest. Thursday is near; lay hand on heart, advise: An you be mine, I'll give thee armour to keep the peace: put up our pipes, and be gone. Nurse Honest goodfellows, ah, put up, put up; For, well you know, this is a kinsman to the day, it did! JULIET O comfortable friar! where is my father, and my mother, cast me not away! Delay this marriage he should