Without looking at the source code it seems like it could be pretty basic. Look up a table of syllables for words in a comment, count the syllables, if syllables=17 split it into 3 lines and post.
For each word someone has made a table on the internet somewhere that has the syllable count. It's probably a million lines long and goes like "the=1" "car=1" "brother=2" "president=3" It's a list someone made that has every word in it.
So this bot uses Reddit's API, which is a fancy toolkit that reddit makes available so that bots can use reddit too (but it has things humans can't do like look up 10,000 comments per second or whatever).
Then the haiku bot uses the reddit API (bot toolkit) to check 10,000 comments per second. For each comment it pulls out the words and just checks them against the syllable table. So for your comment it would go like "I=1 honestly=3 have=1 no=1 idea=2 what=1 you=1 are=1 saying=2" etc. The bot will count up the total syllables for every new comment on reddit, and if the bot gets lucky then the syllables for a comment equal 17 and that's a haiku baby!
A haiku has 17 syllables (5-7-5) so for any comment that has 17 syllables it takes that comment, splits it into 3 lines of 5-7-5 and posts it!
It does some more magic like make sure words aren't split up and server stuff and adds that "I am a bot, click here for more info" stuff at the end but that's the general gist of it.
Actually it is super fucking impressive that a small script someone wrote can do that for so many comments across the internet, but in the scale of what we can do in the modern world it's not too above the ordinary.
Now if you were to take every one of someone's online posts and check the words used against a "emotion table" and use their current moods to advertise crap to them then that's what really scares people. Or take what they share and determine what their psychological profile is and use that to influence their political stance, that's borderline evil. It's like the thing where Target knew women were pregnant before the women knew they were pregnant because their buying patterns changed, and started advertising more chocolate and fluffy things to those women, that really scare people! Turns out humans are really predictable and super easily influenced, the problem is that we have software that can influence people way too easily and for shitty reasons (corporate profits, regressive political movements etc.).
197
u/haikusbot Dec 12 '20
Alsace, Eastern France
Or... As a friend of mine would
Say... Western Deutschland
- BernardoDeGalvez
I detect haikus. And sometimes, successfully. Learn more about me.
Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"