#!/usr/bin/python
#This code takes the grammatical structure of Gwendolyn Brooks' poem "An Aspect of Love, Alive in the Ice and Fire"
#which closes out her short book _Riot_, on Broadside Press. What this code does is slot in, at random, parts of speech 
#from the entire book, creating infinite versions of this poem out of Brooks' own words.

from random import choice, randint


adj = "radiant bright ecstatic young lithe driving splitting whiteblue rose golden right \
best sweaty unpretty rough \
black loud detainable discreet nourished white blackness \
handy thrilling terrific desperate expensive ".split()
verb = "go smile shining shine bear bearing interrupt are accept wonder wondering settle settled settling\
mute rise rises rising \
lying tell told lay unmade clays dusts helps offends offending confer \
range ranging raging rage rages conferring peer peering purr purring signing heralds heralding die dies\
dying hold held holding partake partaking blares blare blaring kill kills killing yells yell yelling\
twittering, lighting, lights, candles, candleing, curse, cursing, invert, inverting, run, running, scatter, scattering,\
siren, sirening, sunning, stomp, stomped, longstomp, longstomped, straddle, straddled, longstraddle, longstraddling,\
stroke, longstroke, longstroking, steal, stealing, stole, steal in hell, stealing in hell, stole in heal, hear,\
heard, hearing, jerk, jerking, jazz, jazzing, sticking, stuck, stick, wiggle, wiggling, cry up, cry down, cry across,\
crying up, crying down, crying across, cry back, cry-forward, cry-to-the-side, crying-to-the-side, hiss, hissing, hisses,\
eats, eat, eating, spread, spreading, reflect, reflecting, label, labeling, rattle, rattling, crunch, crunching, make,\
making, go down, went down, goes down, going down, mock, mocking, thrill, thrilling, wrap, thrillingwrap,\
wrapping, forgot, forget, forgetting, come down, comes down, coming down, were, itch, itching, touch, touching,\
whisper, whispering".split()
noun = "hair, linen, wool, scotch, sculpture, kidney, pie, street, rank, seas, windsweep, black, white,\
world, blackness, angel, sky, announcement, breath, fume, pig, foot, chitterling, chili, doubt, man, today, \
smoke, fire, glass, blood, earth, place, watermirrors, goldenrod, lagoon, chains, cabinet, shelf, cookies, sonatas,\
arabesques, rattles, music, blackblues, kitchen, food, flowers, men, wire, stalks, haunches, hell, radio, hellradio,\
sin, candles,".split()
per_pro = "me, us, you, her, him, it, them all, another, any, anybody, anyone, anything, both, each,\
either, everybody, everyone, everything, few, many, most, neither, nobody, none, no one, nothing, one, other, others,\
several, some, somebody, someone, something, such".split()
reflexive_pro = "myself yourself herself himself itself ourselves yourselves themselves".split()
pos_pro = "my mine ours yours hers his theirs".split()

#this is an edit I am still working on, don't use it.
#def poem():
    #print "\n" + "="*16+" a poem " + "="*16
#for x in range(randint(1,23)):

line0 = " ".join(["It is the " + choice(noun) + " " + "of our " + choice(noun) + "." + "\n\n"])
line1 = " ".join(["in a " + choice(noun) + " " + " in " + choice(noun) + " there is this " + choice(per_pro)])
line2 = " ".join(["how " + choice(adj) + "." + "\n"])
line3 = " ".join([choice(adj) + " " + choice(noun) + " in our " + choice(noun) + ","])
line4 = " ".join([choice(per_pro) + " " + choice(verb) + "," + " we " + choice(verb) + " each other,"])
line5 = " ".join(["are " + choice(adj) + " " + choice(noun) + " and " + choice(noun) + "s." + "\n"])
line6 = " ".join([ choice(adj) + " light is in the " + choice(noun) + "\n\n"])
line7 = " ".join(["Because the " + choice(noun) + " is at the " + choice(noun) + "\n"])
line8 = " ".join(["we cannot " + choice(verb) + " very long." + "\n\n"])
line9 = " ".join([choice(per_pro) + choice(verb) + "." + "\n"])
line10 = " ".join([choice(adj) + "," + choice(per_pro) + " are in " + choice(reflexive_pro) + " again." + "\n"])
line11 =" ".join([choice(per_pro) + " " + choice(verb) + "\n"])
line12 =" ".join([choice(pos_pro) + " " + choice(adj) + " and " + choice(adj) + " " + choice(noun) + "\n"])
line13 = " ".join([choice(per_pro) + " " + choice(adj) + " and " + choice(verb) + " as a " + choice(noun) + "." + "\n"])
line14 = " ".join(["in " + choice(noun) + ". " + choice(per_pro) + " " + choice(verb) + " " + choice(adj) + ", " + choice(adj) + "," + "\n"])
line15 = " ".join([choice(adj) + "." + "\n\n"])
line16 = " ".join(["There is a moment in " + choice(noun) + "\n"])


lines = line0 + "\n" + line1 + "\n" + line2 + "\n" + line3 + "\n" + line4 + "\n" + line5 + line6 + line7 + line8 \
+ line9 + line10 + line11 + line12 + line13 +line14 + line15 + line16
print (lines)
        
 

There are still some kinks to work out, but here is a sample of the output:

 

It is the rattles, of our food,.


in a angel,  in chains, there is this somebody,
how driving.

blackness seas, in our blood,,
you, mocking,, we stuck, each other,
are nourished smoke, and kitchen,s.
best light is in the man,

Because the glass, is at the cabinet,
we cannot eat, very long.

one,tell.
handy,others,several, are in yourself again.
anyone, rage
my whiteblue and nourished chitterling,
no right and longstraddling,stroke, as a blood,.
in doubt,. something, cry rose, best,
handy.

There is a moment in shelf,