Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Added negative trigger words for popular irrelevant triggers to the IA
Browse files Browse the repository at this point in the history
  • Loading branch information
elephant96 committed Jul 14, 2015
1 parent dfcb050 commit 5be5021
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/DDG/Spice/YachtSpecs.pm
Expand Up @@ -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;
5 changes: 5 additions & 0 deletions share/spice/yacht_specs/skipwords.txt
@@ -0,0 +1,5 @@
club
for sale
for charter
harbour
crew

0 comments on commit 5be5021

Please sign in to comment.