Memory Generator

Original poem:

The In Between

My train from Prague to Berlin is as subtle as a raindrop.
The countryside’s confusing, neither Czech nor German…
Nameless hills may qualify as mountains, they may not.

The journey’s five hours, but the in between grips me.
Who dwells within these hidden alluring villages?
My railway line pierces through unknown plot.

Prague reminded me of my grandmother,
The fairy tale capital held me gently.
I longed for childlike towers, my mascot,

The medieval castle evaporates in the distance.
Berlin pulls me inside, an inevitable force,
My study abroad becomes a chilling snapshot.

Berlin’s colder than the steel frames of the buildings,
The streets are like adulthood: anonymous and wide.
Graffiti probes my brain like an odd inkblot.

Construction replaces remnants from the war,
The modernity’s both complex and familiar.
While Berlin sprints, Prague doesn’t even trot.

Exchange students count down to the holiday:
A week to traverse countries, to push our freedom.
We navigate with a map, missing each dot.

I’m tired of searching for unrequited independence,
Our suitcases are filled with mass-produced mementos.
I craved the free fall, yet I stich my net with fraught.

I accept that Prague faded, and that we all reach Berlin,
But I wish my train lasted for a little longer.

In [32]:
sal_adjs = [
    "Beloved",
    "Former",
    "Bygone",
    "Dear",
    "Admired",
    "Cherished"]
In [33]:
sal_nouns = [
    "Memory",
    "Fantasy",
    "Vision",
    "Jewel",
    "Love",
    "Thought",
    "Thought"
]
In [34]:
adjs = [
    'subtle',
    'confusing',
    'Czech',
    'German',
    'nameless',
    'hidden',
    'alluring',
    'unknown',
    'inevitable',
    'chilling',
    'anonymous',
    'wide',
    'odd',
    'complex',
    'familiar',
    'tired',
    'unrequited',
    'mass-produced',
    'fraught'
]
In [35]:
nouns = [
    'train',
    'Prague',
    'Berlin',
    'raindrop',
    'countryside',
    'mountains',
    'journey',
    'five hours',
    'villages',
    'railway line',
    'plot',
    'grandmother',
    'fairy tale capital',
    'childlike towers',
    'mascot',
    'medieval castle',
    'distance',
    'force',
    'study abroad',
    'snapshot',
    'steel frames',
    'buildings',
    'streets',
    'adulthood',
    'brain',
    'inkblot',
    'construction',
    'remnants',
    'war',
    'modernity',
    'exchange students',
    'freedom',
    'map',
    'dot',
    'independence',
    'suitcases',
    'mementos',
]
In [36]:
advs = [
    'affectionately',
    'ardently',
    'anxiously',
    'beautifully',
    'burningly',
    'covetously',
    'curiously',
    'eagerly',
    'fervently',
    'fondly',
    'impatiently',
    'keenly',
    'lovingly',
    'passionately',
    'seductively',
    'tenderly',
    'wistfully'
]
In [37]:
verbs = [
    'grips',
    'dwells',
    'pierces',
    'held',
    'evaporates',
    'pulls',
    'probes',
    'replaces',
    'sprints',
    'trots',
    'counts',
    'pushes',
    'navigates',
    'misses',
    'searches',
    'craves',
    'stitches',
    'faces'
]
In [65]:
# textwrap library used to "wrap" the text at a particular length
import textwrap

# output begins with salutation
output = random.choice(sal_adjs) + " " + random.choice(sal_nouns) + ",\n"
output += "\n"

# inside this loop, build the phrases. strachey implemented "short" phrases
# and "long" phrases; two or more "short" phrases in a row have special
# formatting rules, so we need to know what the last phrase kind was in
# order to generate the output.
history = []
body = ""
for i in range(5):
    kind = random.choice(["short", "long"])
    if kind == "long":
        # adjectives and adverbs will be present only 50% of the time
        line = " ".join([
            "My",
            random.choice([random.choice(adjs), ""]),
            random.choice(nouns),
            random.choice([random.choice(advs), ""]),
            random.choice(verbs),
            "your",
            random.choice([random.choice(adjs), ""]),
            random.choice(nouns)])
        body += line
    else:
        adj_noun = random.choice(adjs) + " " + random.choice(nouns)
        # if the last phrase was "short," use truncated form
        if len(history) > 0 and history[-1] == "short":
            body += ": my " + adj_noun
        else:
            body += "You are my " + adj_noun
    body += ". "
    history.append(kind)
# clean up output
body = body.replace("  ", " ")
body = body.replace(". :", ":")
# put everything together
output += textwrap.fill(body, 60)
output += "\n\nYours " + random.choice(advs) + ",\n"
output += "Nick"
print(output)
Dear Thought,

You are my anonymous medieval castle. My confusing train
held your anonymous villages. My odd study abroad wistfully
craves your hidden buildings. My subtle five hours held your
wide brain. My chilling buildings eagerly trots your
journey.

Yours keenly,
Nick