NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

#NNNGM: On meillä uniseuranta, pöytätietokone, elokuvaääni ja mukanakulkeva #143

Open hugovk opened 4 years ago

hugovk commented 4 years ago

An idea from 2016, done in under 256 chars as a Nano-NaNoGenMo or #NNNGM:

from random import choice as c

print(open("intro.txt").read())

s = open("stuff.txt").read().splitlines()

for _ in range(3843):
    print(f"\nOn meillä {c(s)}, {c(s)}, {c(s)} ja {c(s)}")
    print(f"On {c(s)}, {c(s)}, {c(s)} ja {c(s)}")

Perfect or Black Friday/Weekend/Week, Leevi and the Leavings' Finnish song Onnelliset comments on happiness and consumerism.

However, only eight home appliances are mentioned in the 1981 song.

On meillä stereot, televisio, mikroaaltouuni ja videonauhuri On pakastin, kahvinkeitin, mikroprosessori ja pölynimuri

Translated:

We have a stereo, television, microwave oven and VCR An oven, coffee machine, computer and vacuum cleaner

Nowadays, there's even more stuff we need to acquire! Let's extend it with an extra 23 058 things.

Preview:

On meillä uniseuranta, pöytätietokone, elokuvaääni ja mukanakulkeva On paikannus, vastaanotin, älylukko ja joustokeula

On meillä aktiivisuusranneke, sähköhammasharja, videokamera ja pelikuulokemikrofoni On leikkimökki, prosenttista, autoblaster ja valjas

On meillä tyttönukke, termosmuki, jalustakaiutinpari ja makuupussi On tasoisella, kantojärjestelmä, rakenne ja kiinnitys

On meillä kattila, toimintapelin, järjestelmäkamera ja porttinen On päätarjoukset, pöytälevy, savustusgrilli ja ohjelma

This involved some prep:

raw.txt has 33 pages of Black Friday tat from a webshop.

Then find the, for example, -älykello (smartwatch), -kaasugrilli (gas grill), -televisio (television) and -minikopteri (minicopter) in:

(There's some false positive products in there, but it'll do.)

And cut the initial dash, and sort and remove duplicates:

grep -o "\-[a-zäö]\+" raw.txt | cut -c 2- | sort | uniq > stuff.txt

Then the Python script prints intro.txt, and generates this pattern until 50k words:

On meillä A, B, C ja D
On E, F, G ja H
python on-meilla.py > on-meilla.txt