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

Another text rearrangement: split on pronoun #135

Open
enkiv2 opened this issue Nov 29, 2016 · 0 comments
Open

Another text rearrangement: split on pronoun #135

enkiv2 opened this issue Nov 29, 2016 · 0 comments

Comments

@enkiv2
Copy link

enkiv2 commented Nov 29, 2016

I had been considering some techniques I had seen for constructing text that could be rearranged reasonably, and I noticed that one technique was to always split on the division between subject and predicate. (There was a spoken-word poetry album that did this, such that you could play the album on shuffle and get a meaningfully different story each time.)

I figured, you could do this on an existing full-text corpus in an automated way if you were conservative about where you split. The easiest way seemed to be to split on pronouns, performing splits and random rearrangements on different pronouns separately in order to preserve agreement. So, that's what I did.

Resulting novel (based on Lovecraft): https://raw.githubusercontent.com/enkiv2/misc/master/nanogenmo-2016/lovecraft-split-on-pronouns.md
Code: https://github.com/enkiv2/misc/blob/master/nanogenmo-2016/split-on-pronouns.sh

Essentially, all this code does is perform a sequence of splits, shuffles, and merges -- one for each of he/she/it/I -- and then discards singletons/scraps. The result almost makes sense -- a better result than markov & phrasechain, probably. (I was considering combining this with phrasechain, and maybe in the future I will, but for now shuffles seem to be sufficient.)

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