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

Commit

Permalink
Remove chain detection from Spice (it's moving to Deep) (#3534)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronharsh authored and tommytommytommy committed Aug 28, 2018
1 parent fb25c5e commit 2506619
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/DDG/Spice/Maps/Places.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ spice to => 'https://duckduckgo.com/local.js?q=$1&cb={{callback}}';
spice proxy_cache_valid => "418 1d";
spice is_cached => 0;

my $chains_re = share('chains_re')->slurp;
my $places_re = qr/(local|near|near me|around|around me|here|locally|nearby|close|closest|nearest|locations?|restaurants?)/;
triggers query_lc => qr/(^$chains_re$|^$places_re|$places_re$)/s;
triggers query_lc => qr/(^$places_re|$places_re$)/s;

my %skip_remainders = map {$_ => 0} ('current', 'time');

Expand Down
1 change: 0 additions & 1 deletion share/spice/maps/places/chains_re

This file was deleted.

13 changes: 10 additions & 3 deletions t/Places.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ use DDG::Test::Spice;

ddg_spice_test(
[qw( DDG::Spice::Maps::Places )],
'nearest primos' => test_spice(
'/js/spice/maps/places/nearest%20primos',
'nearest any text' => test_spice(
'/js/spice/maps/places/nearest%20any%20text',
call_type => 'include',
caller => 'DDG::Spice::Maps::Places',
is_cached => 0,
is_cached => 0,
),
'nearest walmart' => test_spice(
'/js/spice/maps/places/nearest%20walmart',
call_type => 'include',
caller => 'DDG::Spice::Maps::Places',
is_cached => 0,
),
'walmart' => undef,
'local time' => undef,
);

Expand Down

0 comments on commit 2506619

Please sign in to comment.