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

#NNNGM: Deuxportrait #39

Open
nmifsud opened this issue Nov 26, 2022 · 0 comments
Open

#NNNGM: Deuxportrait #39

nmifsud opened this issue Nov 26, 2022 · 0 comments

Comments

@nmifsud
Copy link

nmifsud commented Nov 26, 2022

256-character program using the complete works of Mark Twain and Winston Churchill:

import nltk,random
t=[s for s in nltk.sent_tokenize(open('pg3200.txt').read()+open('pg5400.txt').read())if(s.startswith(('My','I am','I do','I can','I have','I would'))&(len(s)<150))]
random.shuffle(t)
print(' '.join((' '.join(t).replace('"','')).split()))

Here's the output (51,967 words). Sample:

I have seen it stated in print that as a boy I had been guilty of stealing peaches, apples, and watermelons. I have made a thousand vows. I am afraid you deserve your loss. I do not know why they have done this, but I think it is from dishonest motives. My father has so many cares, and he tries so hard to do right as he sees it.

This was an attempt to create a novel in the style of Edouard Levé's Autoportrait, which is made up of sentences like these:

The higher the floor number, the better I feel. Sometimes I realize that what I’m in the middle of saying is boring, so I just stop talking. I used to think I worked better at night than in daytime until one day I bought black curtains. I use the shell of the first mussel to spoon out the rest. I can do without TV.

Of course you could get closer to this by using a larger set of more constrained sentence forms (and drawing on more inputs to compensate for how few sentences each would provide). But this nano-entry was enough to scratch my itch!

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

2 participants