From 5be502174c3b7630713da325a03fd8e441337590 Mon Sep 17 00:00:00 2001 From: elephantRunAway Date: Tue, 14 Jul 2015 10:37:54 +0000 Subject: [PATCH] Added negative trigger words for popular irrelevant triggers to the IA --- lib/DDG/Spice/YachtSpecs.pm | 7 +++++-- share/spice/yacht_specs/skipwords.txt | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 share/spice/yacht_specs/skipwords.txt diff --git a/lib/DDG/Spice/YachtSpecs.pm b/lib/DDG/Spice/YachtSpecs.pm index 03f4a4ba21..9bbd0ed906 100644 --- a/lib/DDG/Spice/YachtSpecs.pm +++ b/lib/DDG/Spice/YachtSpecs.pm @@ -24,11 +24,14 @@ spice wrap_jsonp_callback => 1; #Triggers triggers startend => "yacht", "superyacht", "megayacht", "luxury yacht", "motor yacht"; +my $skip = join "|", share('skipwords.txt')->slurp(chomp => 1); # Handle statement handle remainder => sub { - return $_ if $_; - return; + return unless $_; + # Do not trigger IA if query matches any words in skipwords.txt file + return if m/$skip/i; + return $_; }; 1; diff --git a/share/spice/yacht_specs/skipwords.txt b/share/spice/yacht_specs/skipwords.txt new file mode 100644 index 0000000000..66dd5e5c69 --- /dev/null +++ b/share/spice/yacht_specs/skipwords.txt @@ -0,0 +1,5 @@ +club +for sale +for charter +harbour +crew \ No newline at end of file