Why compress a poem? The poem compressor uses an algorithm similar to those used in zip files, jpgs etc, to challenge the notion that a poem contains meaning that cannot be captured more succinctly - even by artificial means.
Enter a poem in the fields below, then click 'compress' to produce a compressed version of the poem. The poem compressor looks for a string of characters that is repeated (you can set the amount - default 5 ), and then replaces the repeated text with a numerical pointer to the original occurence of the text (a kind of length-distance pair
in the jargon). So for instance, if the word "Beethoven" appeared more than once in the poem, at the second and subsequent occurrances, the compressor would insert two numbers - one to indicate the position (e.g. 1 for first character in the poem) of the original occurence of "beethoven", and the second to indicate the length of characters in the string that are repeated - nine characters in this example, or ten if you have a following space. Type "Beethoven Beethoven" into the text box below and compress it to see what I mean.
In this way, for example "to be, or not to be, that is the question" becomes "to be, or not [1,7]that is the question" -- two characters shorter with zero loss of meaning!!
I wrote Lz77
to demonstrate an entire poem compressed in this way (although the method used is slightly different). Note that carriage returns and spaces are counted as one character by the compressor. Also, the title is not compressed. You can view the page source to see how it works (it's a very brute force little script i wrote, not at all clever).
The Poem Compressor