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 = [
In [33]:
sal_nouns = [
In [34]:
adjs = [
In [35]:
nouns = [
    'five hours',
    'railway line',
    'fairy tale capital',
    'childlike towers',
    'medieval castle',
    'study abroad',
    'steel frames',
    'exchange students',
In [36]:
advs = [
In [37]:
verbs = [
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([
            random.choice([random.choice(adjs), ""]),
            random.choice([random.choice(advs), ""]),
            random.choice([random.choice(adjs), ""]),
        body += line
        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
            body += "You are my " + adj_noun
    body += ". "
# 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"
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

Yours keenly,