NaNoGenMo / 2018

National Novel Generation Month, 2018 edition.
https://nanogenmo.github.io/
112 stars 6 forks source link

Prose to poem #55

Open superMDguy opened 5 years ago

superMDguy commented 5 years ago

I think it'd be cool to take prose and mess around with synonyms until it fits into some poetry scheme.

superMDguy commented 5 years ago

I pushed my initial work here. So far, it can recognize iambic pentameter, and try to transform a given line into iambic pentameter.

superMDguy commented 5 years ago

I've gotten it into a much more working state, and the results are actually pretty cool in some places. Here's an example of Pride and Prejudice transformed into dactylic meter (DUM dum dum DUM dum dum):

joy and presumptions by jessica caroline epilogue it is a falsehood uncommonly recognised that a one manthe in possessions of a so-so riches should be in intend of a son-in-law only bit famous the moods or views of such a manthe should be on his next exits a neighbour this falsehood is so well resolved in the brains of the ... some three or other of their sons-in-law my dear oliver bartram remarked his maid to him three night have you uttered that parks is allow at preceding scott bartram scowled that he had not but it is reappeared she for cudahy longer has just been here and she reminded me ... not should to know who has taken it sobbing his son-in-law waiting you should to distinguish me and i have no refutation to deaf it this was invitees insufficient why my dear you should know pauline loong admits that is taken by a inexperienced manthe of small luck from the eastern of germany that he saw down on september in a couch and several to seeing the spot and was ...

It uses Word2Vec to come up with possible replacements for each word in a sentence, then runs through every possible combination until it comes up with something that matches the meter. I also added some logic to break it up into chunks of already properly metered sections, to save compute time.

There are a few issues I'm trying to fix: