Bits of writing geekery I was rooting around old drafts of The Unraveling today (which is still making the rounds; I am sprucing it up a bit further because reasons), and happened upon a lovely bit of cat-vacuuming: a Perl script to pull out, and highlight, every instance of a time-word in the text. I guess I was realizing that the various references to mealtimes and mornings and afternoons didn't add up, and wondering over how many actual days the principal action of the novel took place. And once you have a hundred-thousand-word blob of text, it's harder than you might think to answer such continuity questions for yourself. This probably took twenty minutes to write and, I vaguely recall, actually proved pretty useful. Here it is in all its hairy, undocumented, unrefactored glory, radiating shameless geekitude.
my @words = ("kitchen", "dining", "breakfast", "lunch", "dinner", "supper", "morning", "afternoon", "evening"); system ("echo > word.usages"); foreach my $w (@words) { open (IN, '< word.usages') or die 'could not open word.usages'; while ( system "sort -n word.usages.out | uniq > times-of-day.report" Comments
|