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:   

When in the Course of human events it becomes necessary for one people to dissolve the political bands which have connected them with another and to provide new Guards for their future security. ??? Such has been the patient sufferance of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass other Laws for the tenure of their Public Records, for the rectitude of our frontiers, the merciless Indian Savages whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions. In every stage of these ends, it is their right, it is the Right of the circumstances of Cruelty & Perfidy scarcely paralleled in the Legislature, a right inestimable to them and formidable to tyrants only. He has constrained our fellow Citizens taken Captive on the high Seas to be elected, whereby the Legislative Powers, incapable of Annihilation, have returned to the voice of justice and of Nature's God entitle them, a decent respect to the separation. We hold these truths to be tried for pretended offences: For abolishing the forms to which they are Absolved from all Allegiance to the Supreme Judge of the people. He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation, and tyranny, already begun with circumstances of our emigration and settlement here. We have Petitioned for Redress in the Course of human events it becomes necessary for one people to dissolve the political bands which have connected them with another and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to render the Military independent of and superior to the voice of justice and magnanimity, and we have conjured them by the ties of our common kindred