For my deformance exercise I modified a Java servlet that I am working on. The servlet is a work in progress at this point but I did put Shakespeare’s Sonnet 18 in it and ran the less than three function through my IDE. This allows the servlet to count the number of letters that are in the words (that eventually will be typed in by the user) and it will remove those words that are three letters or less. Here is a look at the some of the code that will make up my servlet (right now I only have functions I do not have an GUI yet)…

Poem Maker by Amanda Perez

What you see above is each line of Sonnet 18 as Strings and the commands that will count the lines (looking for 3 words or less). What you cannot see is the remove object function (just below the last green comment marked as //) which will remove all words three letters or less. (There is a red x on my java project file because I have not finished adding return commands in another class that the class you are looking at imports.) So the above code right now takes Sonnet 18 and deletes all the words that are three words or less. Here is the original sonnet:

SONNET 18
Shall I compare thee to a summer’s day?
Thou art more lovely and more temperate;
Rough winds do shake the darling buds of May,
And summer’s lease hath all too short a date;
Sometime too hot the eye of heaven shines,
And often is his gold complexion dimm’d;
And every fair from fair sometime declines,
By chance or nature’s changing course untrimm’d;
But thy eternal summer shall not fade,
Nor lose possession of that fair thou ow’st;
Nor shall Death brag thou wander’st in his shade,
When in eternal lines to time thou grow’st:
So long as men can breathe or eyes can see,
So long lives this, and this gives life to thee.

And here is the poem after it has gone through the servlet: (I pulled it from my IDE since pasted in word for this post. I did not change the orientation of the output. I did add the * so I could make notes on the lines.)

SONNET 18 (title will always stay the same it is not one of the lines counted)

Shall compare thee summer’s day?*
Thou more lovely more temperate;
Rough winds shake darling buds , **
summer’s lease hath short date;
Sometime heaven shines,
often gold complexion dimm’d;
every fair from fair sometime declines,
chance nature’s changing course untrimm’d;
eternal summer shall fade,
lose possession that fair thou ow’st;
shall Death brag thou wander’st shade,
When eternal lines time thou grow’st:
long breathe eyes,
long lives this, this gives life thee.

*There was no space between “day” and the “?” so it counted it as 4 letters long and was kept
** Here there was a space between “May” and the “comma” at the end of the line

Obviously there are still bugs in the servlet. I did not realize that it would count the punctuation as a character if there was not a space between it and the word and then some three letter words would be kept. When this is done the user will type their poem or piece of prose into the prompt so I am going to have to think about the punctuation problem. Also I am not sure I want it to print with the line breaks and not the white space. I might leave the whitespace (when a word is deleted its space will remain).

Anyway as far as meaning goes some of the lines I like better. Take for example line 9. Suddenly with the deletion of “But, thy and not” the line becomes a darker. Where Shakespeare was trying to say that her beauty will not fade if he preserves her, now we have an affirmation that it will not retain its quality. The poem with the deletion of the words that are three letters of less the new poem is drearier than the original.

As for the servlet, my end intentions are to make it an app that will run for flickr. I wanted to have a user put in key words from one of their photos (people, colors, buildings etc.) and then have a poem be generated from the key words they put in that would “put words to their image.” Not exactly deformance but I might play around with the less than function a little more and see what comes out. I would like to pick a longer piece for my next experiment with the less than fucntion in my servlet.

Advertisements