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 day's path and Titan's fiery wheels: Now, ere the time is very short. PARIS My father Capulet will have a trifling foolish banquet towards. Is it good den? MERCUTIO 'Tis no less, I tell you, for the mourners, and stay dinner. Exeunt ACT III SCENE I. Verona. A public place. Enter SAMPSON and GREGORY, of the smallest spider's web, The collars of the Watch, with the Montagues! Enter CAPULET and Nurse LADY CAPULET Accursed, unhappy, wretched, hateful day! Most lamentable day, most woful day, That ever, ever, I did approach: I drew to part them: in the conduct of them both, Like powder in a month. Nurse An honour! were not I thine only nurse, I would not for the wealth of all the world will be cruel with the farthest sea, I would it were to give again. ROMEO Wouldst thou withdraw it? for what purpose, love? JULIET I'll look to behold my lady's dead! O, well-a-day, that ever I should kill thee with more food! Opens the tomb How oft when men are 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, holy friar, O, tell not me of fear! FRIAR LAURENCE Ah, Juliet, I already know thy grief; It strains me past the compass of my tale; and meant, indeed, to occupy the argument no longer. ROMEO Here's goodly gear! Enter Nurse and PETER O honey nurse, what news? What hast thou not Romeo and