I think one of the problems with the various poetic examples of electronic text is that it lacks the sort of cultural coding that readers expect from genre.  There is a certain resistance to reading and interpreting text so obviously divorced from it’s original meaning and also when it is often impossible to construct a traditional meaning or narrative from what we are reading.  But the disconnect between meaning and aesthetic isn’t so fundamental as the lack of genre.  Whether you are reading poetry, fiction, non-fiction or any other text based genre, you know what you are reading because the genre is announced to you, either aesthetically, or in the title, on the cover of the book.  If you see a poem with fourteen lines you know you’re reading a sonnet.  In order for electronically or algorithmically written text to be read correctly, it must find a way to announce it’s genre as such.  While the process of a piece of electronic text might be what makes the piece interesting, this is not true if the process is made opaque to the reader.  And explaining the process in technical terms isn’t really a great solution either.  The reason that remixes involving music and image/video work so well is because the elements are easily identifiable.  A mix is essentially taking something from a famous song and adding new elements to it.  People like it because they recognize the famous song and enjoy hearing it a new way or maybe they don’t.  To do this with text there must be ways of identifying the source—a couple of possibilities from the top of my head: using a famous source, like “To be or not to be” or using repetition, which is in a way how the grep stuff we’ve looked at works.

With this idea as a premise I started thinking about how I wanted to use the python technology.  I didn’t get very far, because I’m still learning the language, but I wanted to take famous source texts and play with them in a way that would be recognizable to a reader with some familiarity with literature.  I started with The Great Gatsby, because I already had a text file of it on my computer.  Then I downloaded the Bible—a digression: I saw The Girl with the Dragon Tattoo the other night, not having read the books, but knowing obviously about the franchise, and realized that, obviously influenced by the class and the scenes where she is using something that looks like Python to parse text bla bla, that the reason The Bible works so well for conspiracy theories and stuff like that is that all the verses have numbers in front of them, which probably seems like a banal point but numbers are much easier to find in the world that strings of text (as I was soon to discover with my own Python experiments) and therefore it is easy to see the bible everywhere, like John 3:16 in Tim Tebow’s stat sheet—and I thought a simple thing to do would be see if Fitzgerald lifted any references or lines directly from the bible.  Well, it turns out that this was very hard and I also don’t think he did.  I did get some interesting things while I was playing around with trying to get Python to do what I wanted it to.

Then wear the gold hat,
wear the gold hat, if
the gold hat, if that
gold hat, if that will
hat, if that will move
if that will move her;
If you can bounce high,
you can bounce high, bounce
can bounce high, bounce for
bounce high, bounce for her

And thou shalt make loops of blue upon the edge of the one
And thou shalt make fifty loops on the edge of the one curtain
in the coupling, and fifty loops made he upon the edge of the curtain
chased them, and when they were all fallen on the edge of the sword,
choose thou a place, choose it at the head of the way to the city.
And a cubit on the one side, and a cubit on the other side of
upon the other side of it.

Here’s my code, which doesn’t work exactly how I want it to, but I’m still working on.  Basically what it does is divide up the lines of Gatsby into strings of words of whatever length you specify and then reads through the bible to see if there are matches, and then prints the matches.  I’m not sure if it is actually going through both files all the way.  The cool thing though is you can reverse the files or substitute different files, so in a very loose way, you get one story filtered through a different story.  The more sort of basic idea of this is pretty interesting to me, even though we’re not supposed to be working with narrative.  So, finally, the code:

import sys
args = sys.argv

filter_txt_file = args[1]
source_txt_file = args[2]
how_many_words = int(args[3])

filter_txt = open(filter_txt_file, 'r')
source_txt = open(source_txt_file, 'r')

filter_lines = filter_txt.readlines()
source_lines = source_txt.readlines()

print filter_txt_file
print source_txt_file
print how_many_words

for line in filter_lines:
	line = line.strip()
	words = line.split(" ")
	for i in range(len(words)):
		if words[i] == "":

	if len(words) > 1:
		for h in range(len(words)):
			key = words[h:h+how_many_words]
			if len(key) == how_many_words:
				output = " ".join(words[h:h+how_many_words])

				for comp in source_lines:
					comp = comp.strip()
					finder = comp.find(output)
					if finder != -1:
						print comp
						print output, i

This wasteland thing was helpful for figuring out how to load and parse text.


Author: owen ribbit


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s