dariusk / NaNoGenMo-2014

National Novel Generation Month, 2014 edition.
257 stars 17 forks source link

print(25,000) I'M IN yes the Python lessons are coming along nicely thanks for asking #15

Open tullyhansen opened 9 years ago

tullyhansen commented 9 years ago

Doing this this year, yeah.

tullyhansen commented 9 years ago

Dev Diary 2014-11-07

I skipped my intended MVN (minimum viable novel - ALARM, the word 'beep' fifty thousand times) and have instead been noodling about with BBEdit and regular expressions, particularly Multi-File Find. I've been pointing the following expression…

\b((She|He) \w+?ed\b[^"“”A-Z]+?[.?!])

… at the folder of 50 SF Masterworks .epubs I torrented some time back (and never read). Basically pulling for (likely) complete past tense sentences in which 'he' or 'she' does something, while seeking to avoid any pesky punctuation or proper nouns. The resulting lines are sorted on second word, using BBEdit's Sort Lines… and subpattern matching:

\bS?[Hh]e (.*)

Which yields something like:

He continued on then, searching for the vacuum cleaner. She continued silently scrubbing, her eyes coming up every few seconds to check the blood pressure monitor. She continued skimming, back and forth . She continued standing outside. He continued stroking her hair but it had become a mechanical action, without volition or desire. She continued to face me, her back to him.

So far I think there's something there…? Perhaps unsurprisingly, "He x'd"s outnumbers "She x'd"s by a factor of three. Have been considering the possibility of flipping gender of the sentences (again, think this is pretty doable with RegEx, in two halves), but haven't thought through technical/grammatical/theoretical implications of this.

Once I have the patterning down I figure I can turn it into a python/shell script of some sort p. easily? Or at worst an Applescript.

hugovk commented 9 years ago

Might work well to alternate He... She... sentences and ditch the excess.

cpressey commented 9 years ago

Definitely scores some points* so far for using something that isn't generally recognized as a "programming language" to generate the text. (Last year, one of the entries was generated using a video game construction kit. I liked that.)

*in my personal points scale, whatever that might be exactly. I would have said "scores some points in my book", but in this context that idiom is, er, fairly confusing.

tullyhansen commented 9 years ago

@hugovk: I'll likely try this, too, though I'm not sure whether the asymmetry is a boon. @cpressey: Thanks! I'd use a proper programming language if I could, and part of the impetus in playing this year is to mess about in Python, but I'm not yet at that point. Something else I'm considering is how to deal with 'it' sentences, e.g.:

He controlled it as best he could, unwilling to sound the alarms on the telemetry.

I wonder whether him/her respectively as a drop-in replacement might work/be interesting, though it's not always so grammatically simple (as in the case of 'He decided it did.')…

hugovk commented 9 years ago

The vague, unknown it works quite well.

cpressey commented 9 years ago

@tullyhansen Ah, well, improving one's chops at a technology with which one is unfamiliar (and this includes programming languages) is a noble NaNoGenMo goal too, of course. Actually, just generating 50k meows in some 'orrible language like Malbolge or Wierd would be a feat.

@hugovk As I was typing the previous paragraph it occurred to me that the pronoun one is also vague and unknown and

One controlled it as best one could, unwilling to sound the alarms on the telemetry.

Hmmmm.

MichaelPaulukonis commented 9 years ago

Speaking of obscure technologies, somebody's trying to rewire Nethack to output text.

MichaelPaulukonis commented 9 years ago

Any update?