duckduckgo / p5-app-duckpan

DuckDuckHack OpenSource Development Application
http://metacpan.org/module/App::DuckPAN
Other
54 stars 47 forks source link

FatHeads - add support for trigger words #368

Closed GuiltyDolphin closed 7 years ago

GuiltyDolphin commented 8 years ago

This allows better emulation of the triggering on production by providing a means of specifying trigger words.

Currently just accepts a trigger_words.txt file in the same directory as output.txt (not required) for trigger words; we could potentially have a CL option as well.

cc @moollaza @jbarrett

jbarrett commented 8 years ago

Nice! I think trigger_words.txt is a convention we just made up during perldoc development, so a CL option would be cool for other ones... Or we could just adopt trigger_words.txt as a thing.

GuiltyDolphin commented 8 years ago

@jbarrett I thought it would be a pretty good convention to start (and the file doesn't need to be comitted for it to work), as @jdorweiler said:

@jbarrett How about put the trigger words in a separate file trigger_words.txt? I'll have to add them manually to our internal list of triggers but at least they will be documented in a place where everyone can see them.

It would help document how you expect the FatHead to trigger.

But sure, I can add an option for triggers.

jdorweiler commented 8 years ago

You're right, I just made trigger_words.txt up :smile: I'm going to start asking everyone to include one though.

moollaza commented 8 years ago

I was actually going to add support for trigger words via the Metadata. We already have a place to define them on the IA Pages so I figured we might as well use that?

@jdorweiler @jbarrett @GuiltyDolphin what are your thoughts?

jdorweiler commented 8 years ago

Maybe @zachthompson remembers but I tried adding trigger words to the triggers field on the IA page and it broke some stuff. I don't know if that was ever fixed.

moollaza commented 8 years ago

I tried adding trigger words to the triggers field on the IA page and it broke some stuff.

@jdorweiler you mean simply have the IA page trigger words filled out created problems? I have them filled out for https://duck.co/ia/view/mdn_css, and it seems fine? That's what I was going to use to get it working via metadata.

GuiltyDolphin commented 8 years ago

@moollaza Hmm, metadata would be a good option - @jdorweiler it shouldn't be an issue if we ensure triggers are reviewed before deploy? At the least we could use it in 'testing'.

Edit: @moollaza it looks like the triggers aren't provided through the public metadata? I can't seem to access it through DDG::Meta::Data.

GuiltyDolphin commented 8 years ago

@jdorweiler @moollaza @jbarrett What do you think would be the best way to do this?

moollaza commented 7 years ago

@GuiltyDolphin Thanks! This LGTM :+1: