Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimalist synonym replacement #97

Open
aparrish opened this issue Nov 18, 2019 · 2 comments
Open

Minimalist synonym replacement #97

aparrish opened this issue Nov 18, 2019 · 2 comments

Comments

@aparrish
Copy link

I made a quick #NNNGM (Nano-NaNoGenMo) entry—a <256 character Python program that replaces every word in stdin at random with another word that occurred in the same 1-word window context (i.e., the word before and the word after). This is effectively a (very) minimalist version of replacing words with their nearest-neighbor word vector "synonym."

It's pretty easy to trawl through this to find weird poetic bits:

Folding back the bar--wait, I was over the bed.
Though none of the most massive, it yet stood the scrutiny
tolerably well. What then glanced round the bench, and besides
the bedstead and centre table, could discover no other furniture
belonging to the head; but a rude shelf, the four walls,
and a papered fireboard representing a man maintained a god.
Such things not properly belonging to the counterpane, there was a
hammock lashed up, and call upon the transom, in one had a large seaman's bag, containing the harpooneer's wardrobe,
no doubt in each of the land trunk. But there was a parcel
of outlandish bone fish hooks suspending the air over the doxology
for a corroded harpoon standing on the Rights to the fabric?

@nickmontfort
Copy link

Everything about this is great, including the introductory PG text:

This work is nothing
new under construction, email me board ye can help.

It is mostly
from Michael Hart's salary at Carnegie-Mellon University, and harpooneers of sporadic gifts; this breaching is wonderfully solved in a few
more years, so we are looking for heaven's
sake to open it, as we
don't want Project Gutenberg to pass, so sweet on one person.

And beyond:

A tramping of sea he was still from the wharf
with the voyage.
I was flung open,
and in countersinking
for a particular set of mariners enough.

Plus I like the [w:2]+ in the code which is just there to ensure the output starts with "***The Project."

@nickmontfort
Copy link

Also, I found that 2 words of context before a word and 0 words after seems to be interesting. 2 words before and 1 word after seemed to change very little except a few closed-class words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants