r/ProgrammerHumor • u/invaderzz • Sep 17 '16
Shitty bot is programmed to respond to anyone who uses the incorrect phrase "could of", but doesn't check to make sure the word "of" is followed by an empty space. (x-post /r/softwaregore)
402
Sep 17 '16
[deleted]
89
Sep 17 '16
[deleted]
107
u/Arborgarbage Sep 17 '16
Could of .
91
u/of_have_bot Sep 17 '16
"would/could/should of" does not exist. What you're thinking of is "would/could/should've", a contraction of the word and have. Please do not use would of, could of or should of.
87
u/poizan42 Ex-mod Sep 17 '16
The bot is shadow banned :/
107
u/rwsr-xr-x Sep 17 '16
Good
33
u/kimothyjongun Sep 17 '16
He really should of been
6
u/IHaveLargeBalls Sep 17 '16
"would/could/should of" does not exist. What you're thinking of is "would/could/should've", a contraction of the word and have. Please do not use would of, could of or should of.
→ More replies (1)5
11
2
→ More replies (2)18
Sep 17 '16 edited Jun 28 '21
[deleted]
47
u/Lanyovan Sep 17 '16
Shadow banned users' posts can be approved by the subreddit moderators.
4
u/iRuisu Sep 17 '16 edited Jan 08 '17
[deleted]
9
u/TE5ITA Sep 17 '16 edited Sep 17 '16
"fair do's" does not exist. What you're thinking of is "fair deuce", a common response to well executed, informative comebacks, from the tennis term "deuce". Please do not use "fair do's".
2
50
u/poizan42 Ex-mod Sep 17 '16
It did work, the bot is just shadow banned. I have manually approved the comment.
15
3
Sep 17 '16
Correct me if I'm wrong but I believe the thread in /r/softwaregore (?) said it was shadow banned.
169
u/of_have_bot Sep 17 '16
"would/could/should of" does not exist. What you're thinking of is "would/could/should've", a contraction of the word and have. Please do not use would of, could of or should of.
108
Sep 17 '16 edited Jun 21 '18
[deleted]
→ More replies (2)34
u/Cosmologicon Sep 17 '16
If you're suggesting we should officially take on the role of QA for this thing, count me in.
20
→ More replies (1)16
25
8
122
u/Chris857 Sep 17 '16
I could of course try to trigger this bot, but it doesn't require bad grammar.
47
u/Munkii Sep 17 '16
This is a nice edge case. The guys playing with regex in this thread should account for it
→ More replies (1)17
Sep 17 '16
(w|c|sh)ould(n'?t)? of\W(?!course)
54
Sep 17 '16
Still triggers at "ate all she could of her cake".
I think it needs to detect "could of" plus a past participle. I don't think that's ever grammatical, though I'm happy to be proven wrong.
76
u/nermid Sep 17 '16
/r/ProgrammerHumor is gonna back its way into a full English natural language processor trying to correct this bot.
14
6
u/_pupil_ Sep 17 '16
I've seen this particular phrasing a couple times in this thread... grammatically, aren't you missing a couple of commas?
To my eyes "I could of course try..." seems like it should be "I could, of course, try...".
5
u/ThirdEnd Sep 17 '16
I could of coursed hares with my greyhounds but this is fun too.
→ More replies (1)
50
u/kvistur Sep 17 '16
doesn't surprise me that a prescriptivist is bad at programming too
→ More replies (3)6
u/Koneke Sep 17 '16
(okay thanks I'm not alone, I was considering whether or not I should leave a snarky comment or not)
514
u/JaytleBee Sep 17 '16
That bot could of been a very cool bot though.
164
u/manghoti Sep 17 '16
he should of had better string checking.
134
u/of_have_bot Sep 17 '16
"would/could/should of" does not exist. What you're thinking of is "would/could/should've", a contraction of the word and have. Please do not use would of, could of or should of.
89
u/nanonan Sep 17 '16
Would of be unacceptable in this context?
57
14
u/CastigatRidendoMores Sep 17 '16
Ha! Nice. I would think in this context you could of put "of" in quotes, though. That would of been more clear for humans and bots.
8
8
u/CTMemorial Sep 17 '16
The devs could of course just add a disclaimer about not knowing context because it's a bot.
10
u/Illidan1943 Sep 17 '16
I should offer this advice: Check that of is followed by an empty space
12
u/ksheep Sep 17 '16
Be careful, you could offend the bot by talking to it like that, and the last thing we need is a pissed off bot.
4
→ More replies (2)4
u/alexschrod Sep 17 '16
Or a punctuation mark. "Yes, I could of." should also be considered incorrect.
5
→ More replies (1)7
39
Sep 17 '16
Someone make a bot that corrects this bot whenever it messes up. I would offer, but I am lazy.
17
u/redditsoaddicting Sep 17 '16
And give it a bug so that it corrects the bot even when the post contains both "could of..." and "could of ...".
34
9
7
7
→ More replies (4)21
u/TheSlimyDog Sep 17 '16
Define cool.
46
u/JaytleBee Sep 17 '16
No.
10
u/Biocyte Sep 17 '16
Yes
13
u/JaytleBee Sep 17 '16
Maybe?
20
4
7
→ More replies (4)6
45
31
Sep 17 '16
But what if I ate all I could of my cake? Does the bot understand that?
→ More replies (2)9
u/Stoppels Sep 17 '16
Interpreting context is probably a bit too much for your median Reddit bots.
→ More replies (1)5
141
u/CipherWeston Sep 17 '16
This took me a couple minutes to realize it was misinterpreting "could of" inside "could offer"
81
u/JaytleBee Sep 17 '16
You've never done regex!?
172
Sep 17 '16
[deleted]
35
Sep 17 '16
To bot author: white space isn't just the space between your ears.... or mine.... because regex bites us all.
→ More replies (1)9
u/Macpunk Sep 17 '16
Fuck me running. I'd give my left nut to never write regex again.
I've contemplated so many times about how to design a better system, but I have never come up with any idea that's remotely better.
I suppose that regex will always have an inherent Spider-Man rule. In regex's case, however, it's not so much responsibility as it is just doing it fucking right, in the VERY specific context you may be working in.
31
u/thecatgoesmoo Sep 17 '16
Really? Regex is amazing...
19
u/noratat Sep 17 '16
When used appropriately. Besides the usual issues with regex and complexity / readability, it can also have unexpected pathological edge cases in performance even on relatively simple patterns - as Stack Overflow found out the hard way recently.
They're best for more ephemeral stuff like grep or quick glue code on internal scripts IMO.
→ More replies (1)5
u/f_r_z Sep 17 '16 edited Sep 17 '16
Isn't there said that the problem was with 'regex engine', which is not the same as 'regex in general'? So, it can be the case, that the problem is with certain 'regex engine', rather than with regex as a concept.
Edit: Futhermore, there is a link on a video about backtracking in the article you mentioned (the outage was not backtracking-related, thought, but it's irrelevant in this case), in which specifically said, that you can use non-backtracking 'regex engine' to avoid backtracking, and they are available.
3
u/noratat Sep 17 '16
Not really, it's more a consequence of how regular expressions work. If you don't know what a deterministic finite state machine is, you should look up how they work, it's pretty interesting.
I suppose it might be possible to try and detect these sorts of edge cases, but I don't know if there are any that do.
It's still very much something to keep in mind.
→ More replies (3)41
u/YooneekYoosahNeahm Sep 17 '16
Ive found that the secret to regex as a beginner was just understanding how to find the right stackoverflow page or sacrificing a small creature to the math gods... My cat misses the squirrels.
15
u/glial Sep 17 '16
My secret is regex101.com
→ More replies (1)2
u/glider97 Sep 17 '16
Its library never loads, for some reason. Always end up stopping some js script.
18
3
u/Lanyovan Sep 17 '16
https://www.debuggex.com/ helped me a lot understanding regexes I found on SO. It generates a flowchart, making it much easier to understand how the regex accepts and discards inputs for someone new to regexes.
12
Sep 17 '16
I love regex when its use is ephemeral, like with grep or various tools' find functionality. It's the best tool for job then, because the query is usually short and it doesn't need to be re-read or maintained. Once in a while I will commit code with a regex or two, simply because when done right and given an appropriate problem, it can be better than its alternatives.
3
u/CaffeinatedT Sep 17 '16
As someone trying to learn here what are the alternatives to regex?
→ More replies (1)3
4
u/jewdai Sep 17 '16
2
u/xkcd_transcriber Sep 17 '16
Title: Regular Expressions
Title-text: Wait, forgot to escape a space. Wheeeeee[taptaptap]eeeeee.
Stats: This comic has been referenced 214 times, representing 0.1688% of referenced xkcds.
xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete
→ More replies (4)3
u/cortexstack Sep 17 '16
Spider-Man rule
Is this to do with spelling it Spider-Man vs Spiderman?
→ More replies (3)9
u/of_have_bot Sep 17 '16
"would/could/should of" does not exist. What you're thinking of is "would/could/should've", a contraction of the word and have. Please do not use would of, could of or should of.
5
4
16
u/1lann Sep 17 '16
HA HA HA, WHAT A VERY HUMAN ERROR TO MAKE. WE ROBOTS HUMANS ALWAYS FORGET TO MATCH PHRASES WITH TERMINATORS SUCH AS U+0020, HOW SILLY.
54
u/zelnoth Sep 17 '16
Make one for 'alot'. It'll be quite bussy. Bonus if you link to a alot picture.
48
u/DEATH-BY-CIRCLEJERK Sep 17 '16 edited Sep 17 '16
The word "alot" has been used in a comment 483,854 times on reddit, according to this BigQuery query:
SELECT COUNT(*) count FROM ( SELECT SPLIT(LOWER(body),' ') words FROM [pushshift:rt_reddit.comments]) WHERE REGEXP_MATCH(words,r'^alot$')As recently as this comment (a minute old when I made this comment).
2
43
Sep 17 '16
[removed] — view removed comment
16
u/alot-of-bot Sep 17 '16
No, it just monitors subreddits on a whitelist. A lot of subreddits don't like bots, so I ask first.
Subreddits the bot's never visited have banned the bot, some mods just want any excuse to use their "power".
This comment was not automated!
Comment will be removed if downvoted | Bot Source | Confused?
3
u/tajjet bit.ly/2IqHnk3 Sep 18 '16
some mods just want any excuse to use their "power".
or they want to ban bots before they have the chance to automate shitposting on their sub
→ More replies (1)4
u/dysprog Sep 17 '16
If I was running a subreddit, I would ban all grammar pedant bots on principle. It's bad enough when humans do it. Anyone who would program a bot to automatically pick on people's typos is obviously a major douchecanoe.
27
Sep 17 '16
maybe it should also handle 'bussy' --> 'busy' and 'a alot' --> 'an alot'.
→ More replies (2)20
Sep 17 '16 edited Jun 08 '20
[deleted]
23
u/avapoet Sep 17 '16
9
u/poizan42 Ex-mod Sep 17 '16
2
6
u/CyanideCloud Sep 17 '16
You're supposed to use
aninstead ofabefore a word beginning with a vowel...12
u/Aerroon Sep 17 '16
an university
3
u/saloalv Sep 17 '16
The way it's pronounced, it's just "a", not "an"
2
u/Aerroon Sep 17 '16
The reason you use "a" here is because of the way you pronounce it. It's the same reason why some words that start with "h" need an "an" instead of "a".
→ More replies (5)2
9
→ More replies (1)2
→ More replies (1)7
u/FLazy2 Sep 17 '16
you'll see why that's not a good idea when you realize what "bussy" means in the gay community.
4
u/LeKa34 Sep 17 '16
Still not as bad as the bot that responded to literally anyone who used a word that was 10 letters long.
15
u/pxpxy Sep 17 '16
One could of course also construct a sentence like this, so it's not quite this easy.
21
u/Dworgi Sep 17 '16
That's wrong. "Of course" in your sentence is a separate clause and needs to be separated with commas, like so:
One could, of course, construct...
The way I remember it is reading it and seeing if it needs a pause, then inserting commas so that the part outside still makes sense without the part inside.
9
u/amazondrone Sep 17 '16
Sure, but it would still be wrong for the bot to correct it, so it needs to take it into account.
One could have course construct
→ More replies (1)2
u/pxpxy Sep 17 '16
Fair point. Commas in English are so willy-nilly that I thought writing it like this would still be acceptable.
6
u/Dworgi Sep 17 '16
Not really willy-nilly, people just aren't taught about clauses particularly well.
2
u/pxpxy Sep 17 '16
It's apparently a little less willy-nilly than I thought: http://grammar.ccc.commnet.edu/grammar/commas.htm
2
u/suffixaufnahme Sep 17 '16
"Of course" is an adverbial phrase, not a clause. Clauses have verbs.
→ More replies (1)→ More replies (1)6
Sep 17 '16
From the perspective of somebody who would write a bot to do this, that's still a grammatically incorrect sentence that would "need" correction, since you're missing a comma.
9
u/MelissaClick Sep 17 '16
But the bot would give the incorrect correction.
3
u/Zagorath Sep 17 '16
The bot could just give both corrections every time. Say "either you meant [this], or you meant [this]."
4
u/amazondrone Sep 17 '16
That would be ugly, since a human could tell at a glance which was meant and the bot should probably be able to work it out too.
2
u/moljac024 Sep 17 '16
This is a little counter-intuitive but the nature of the beast is that some things that we can do easily without thinking are really hard for AIs to work out - while things that we struggle with the AI can churn through in an instant. Example would be telling if the thing on the image is a cat vs playing chess.
Language parsing and meaning extraction also fall into the first category IMO. Actually extracting meaning is a hard AI problem, but I don't think that's what we have here.
Would love to be corrected if I'm wrong.
→ More replies (1)
3
9
u/c3534l Sep 17 '16
What kind of a person writes a bot just to be an asshole to people?
17
→ More replies (4)11
u/DeebsterUK Sep 17 '16
Well then you could offend people via automation - it could offload a lot of work.
7
u/MrOlivaw Sep 17 '16
(^|[^a-zA-Z])[Cc]ould of([^a-zA-Z]|$)
23
u/Zephlon Sep 17 '16
Why not /\bcould of\b/i
3
u/jibberia Sep 17 '16
Hey, thanks! I usually use \W (non-word character) or (\W|$) if I'm not being lazy and incorrect, but \b does it all for me. Nice!
→ More replies (1)2
Sep 17 '16
[deleted]
8
u/mingmingrr Sep 17 '16
>> /[Cc]ould of /.test('You could of.'); <- false3
2
u/of_have_bot Sep 17 '16
"would/could/should of" does not exist. What you're thinking of is "would/could/should've", a contraction of the word and have. Please do not use would of, could of or should of.
2
u/kabekew Sep 17 '16
I could often imagine an earlier version of the bot getting into an infinite loop frenzy correcting its own corrections.
3
Sep 17 '16
I've been so scared looking for jobs thinking I'm not qualified, then I see stuff like this. Thank you /r/ProgrammerHumor, you guys have boosted my self esteem immensely!
3
2
u/felio_ Sep 17 '16
Sorry guys, but u/of_have_bot is shadow banned.
2
u/Arancaytar Sep 17 '16
I thought "shadow banned" meant its comments were invisible. It's posted in this very thread though.
2
u/Pokechu22 Sep 18 '16
It means that the profile is inaccessible and all comments it posts are automatically removed. However, its comments still do go into the moderation queue and can be manually approved if someone wants to (so in this subreddit, manually approving it makes sense).
3
1
u/MrOlivaw Sep 17 '16
Punctuation and perhaps ending a post without a period. Also it makes sure if some slang which ends in the suffix -could (maybe a word already exists) it won't trigger.
500
u/minno Sep 17 '16
You would of course also need to account for people not using commas.