Tuesday, April 10, 2007
Skipping reality
My last few posts have been of the lazy kind--just throw up something cute and clever (or mimetically cute and clever) from whatever is lying on the desk. In my case they've been test poems. I've been working through the definition of a grammar. After each new structure, I run a test using just that structure to make sure it works. The result is a poem with only one possible "sentence." Sometimes these are interesting, usually not. But they do make me smile from time to time. And they make for easy postings.
However, there is actually a lot of serious work underpinning these little Frankensteins. The TAG trees themselves are coming along quite nicely. I've made some adjustments to the approach. A tree can contain root, terminal, and non-terminal nodes. The non-terminals can either exist somewhere between the root and a terminal, or they can exist at the terminal end, it which case they have to be adjoined (and the software takes care that that happens). A node can also be a tree, in which case the adjoining is a little simpler, but not much. The end result is a straightforward composite pattern that simply unrolls itself at runtime.
The trees themselves are defined in Xml files in a very simple structure:
We have a utility that reads the Xml and inserts its trees into a TagTree table, another utility to create "grammars" and assign trees to them. A "grammar" as defined in the database is just a foreign key that groups trees together. (Three tables: grammar, tagtrees, and grammartagtrees--really quite straightforward.) This allows for any given tree to be a member of any grammar. It also means that if you get a tree that consistently results in lines that suck, you can just delete the tree from the grammar--no code change and the tree is still around if you want to use it someplace else.
I have a grammar named "junk" that I use for testing. What I've been doing is adding a new tree, then adding it to "junk," run some tests and then add that tree to the particular production grammar I happen to be working on. Right now I'm using Frank O'Hara as a grammar source. (You just got to love a guy who writes "All lives fade in the fog/ like the cat that gets fucked/ purple and white and invisible.")
Where I'm trying to get to is a place where the grammar isn't simply speculation, but has a basis in what's recognizable as poetry. How's this?:
Of medicine
Men on a man,
skipping universes and skipping
men
Men by a man,
skipping universes and
skipping existence
Existence in a universe,
skipping earths and
skipping existence
Universes within a man, skipping universes
and skipping universes
Realities within an earth, skipping
universes and skipping realities