duckduckgo / zeroclickinfo-goodies

DuckDuckGo Instant Answers based on Perl & JavaScript
https://duckduckhack.com/
Other
980 stars 1.76k forks source link

President of the United States (POTUS): shouldn't trigger on president-elect #3760

Closed bsstoner closed 7 years ago

bsstoner commented 7 years ago
screen shot 2016-11-17 at 7 48 28 am

IA Page: http://duck.co/ia/view/potus Maintainer: @numbertheory

mintsoft commented 7 years ago

This is actually really strange; with the query who is the president-elect of the us the value of $rem on https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/POTUS.pm#L22 is who is the whereas I wouldn't expect it to trigger at all because the string president of the us isn't present in the query.

Feels like it might be broader than just this IA's interesting triggering mechanism misfiring

nalinbhardwaj commented 7 years ago

@bsstoner @mintsoft I can't seem to be able to trigger the IA. Was it shut down or something due to the aforementioned issues?

moollaza commented 7 years ago

I can't seem to be able to trigger the IA. Was it shut down or something due to the aforementioned issues?

Yes it was taken offline

whereas I wouldn't expect it to trigger at all because the string president of the us isn't present in the query.

@mintsoft that's really odd...possibly a bug in DuckDuckGo Repo.

Either way, one big issues is that the regex inside the handle is not anchored. We need to ensure that the query only matches the phrases we expect and nothing else.

For example it currently triggers on "who is the worst president of the us" which it should not!.

If we anchor the regex and compare it against the whole query we should be able to prevent all false-positives 👍

mintsoft commented 7 years ago

@moollaza is it worth fixing this or has it been replaced by the wikipedia fatheat thingymabob?

bsstoner commented 7 years ago

It will likely be made irrelevant in the near future.

moollaza commented 7 years ago

Looks like our Wikipedia Instant Answer covers just about all the "Nth president of the US" type queries:

https://duckduckgo.com/?q=23rd+president+of+the+united+states&ia=web

Perhaps we should just remove this IA 👍 -- It's already offline anyways.

moollaza commented 7 years ago

We don't seem to handle the "who is/was the nth president" style queries though Wiki is usually the first result. I've merged your PR @mintsoft I suppose we can keep this around a little bit longer if we want.

mintsoft commented 7 years ago

@moollaza I say delete it if it's not needed 👍

moollaza commented 7 years ago

A few users have noticed this IA is offline. There are a few queries that the Wikipedia Fathead doesn't handle, e.g. "potus 15"

I suppose we could keep it around with a reduced trigger space?