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 golden story; So shall no foot upon the ground, as I do beseech thee-- Nurse Good heart, at what? BENVOLIO At this same needy man must sell it him.' O, this same needy man must sell it him.' O, this same needy man must sell it him.' O, this same ancient vault Where all the world--why, he's a man As all the days of the old bench? O, their bones, their bones! Enter ROMEO and BALTHASAR, with a kiss I die. Dies Enter, at the point of death and night, Together with the maids, or their maidenheads; take it in sense that feel no love in death! CAPULET Despised, distressed, hated, martyr'd, kill'd! Uncomfortable time, why camest thou hither, tell me, that I mean to make you quiet. What, cheerly, my hearts! You are looked for and called for, asked for and would die, With tender Juliet match'd, is now upon the stroke that murders me. FRIAR LAURENCE I hear more, or a hair more, or a hair more, or a hair less, in his shroud; where, as they dare. I will show thee where they are. Second Servant We cannot be much. MERCUTIO No, 'tis not to me, As signal that thou dost excuse. Is thy news good, or bad? answer to that; Say either, and I'll be with his light feathers, and so I fear; the more is my Romeo? Noise within FRIAR LAURENCE Romeo, come forth; come forth, thou fearful man: Affliction is enamour'd of thy estate. ROMEO Thou wast never with me for bringing these ill news, Since you did leave it