duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

Currency: Support 'Currency' trigger #3214

Closed pjhampton closed 7 years ago

pjhampton commented 7 years ago

Problem

In https://github.com/duckduckgo/zeroclickinfo-spice/commit/d6207c9804607d4d28234879a242f8ffd28df705, I added an edge case to stop the currency IA from trigger when a number wasn't present. This was to stop false positive triggering and resolve ambiguity. For example:

screen shot 2017-03-28 at 10 53 39 am

From feedback, and internal unanswered query data we should still trigger this Instant Answer if the currency keyword is present. For example, usd currency, or GBP currency. This issue would be well suited to some new to DuckDuckHack.

Solution

  1. Add 2 or 3 tests
  2. Build in logic to handle this
  3. Run tests / test on duckpan
  4. Send a PR

People to notify

@pjhampton

Get Started

Resources


Instant Answer Page: https://duck.co/ia/view/currency

lernae commented 7 years ago

@pjhampton I'm interested in taking this up. Can you clarify if the expectation is to have results for queries of form: a. "usd currency", "gbp currency", (with no amount) etc. or b. "1 usd currency", "1 gbp currency" (requiring an amount)
If queries of form a. should now return results then should queries such as "usd", "gbp" also now return results?

pjhampton commented 7 years ago

Hey @lernae

I'm interested in taking this up.

Awesome! Thanks so much! 😄

Can you clarify if the expectation is to have results for queries of form: a. "usd currency", "gbp currency", (with no amount) etc. or b. "1 usd currency", "1 gbp currency" (requiring an amount)

Both of these should trigger 👍

If queries of form a. should now return results then should queries such as "usd", "gbp" also now return results?

No, because that undoes the previous commit. You will need to alter that one line conditional I introduced