diff --git a/lib/DDG/Goodie/RgbColor.pm b/lib/DDG/Goodie/RgbColor.pm index 434fdd830..6ab982196 100644 --- a/lib/DDG/Goodie/RgbColor.pm +++ b/lib/DDG/Goodie/RgbColor.pm @@ -20,7 +20,7 @@ zci is_cached => 0; my @opposite_words = ('opposite', 'complement', 'complementary'); my @color_words = map { $_, "${_}s" } ('color', 'colour'); -my @mix_words = ('mix', 'mixed'); +my @mix_words = ('mix', 'mixed', 'mixing'); triggers any => @color_words, @mix_words, @opposite_words; ##################### @@ -46,8 +46,13 @@ my $color_name_re = '(?:' . my $scolor = 'colou?rs?'; my $color_re = "(?:$color_name_re|#?\\p{XDigit}{6})"; +# Some stop words relevant to color queries. +my @custom_stops = ( + 'make', 'makes', + 'paint', 'paints', +); my %stops = (%StopWords, %{getStopWords('en')}); -my @stopwords = keys %stops; +my @stopwords = (keys %stops, @custom_stops); my $stop_re = '(?:' . (join '|', map { quotemeta $_ } @stopwords) . ')'; my $black = Color::Library->color('black'); diff --git a/t/RgbColor.t b/t/RgbColor.t index 9710140ad..ba58932fb 100644 --- a/t/RgbColor.t +++ b/t/RgbColor.t @@ -223,6 +223,7 @@ ddg_goodie_test( 'what do you get if you mix blue and orange' => $tc_mix_blue_orange, "what's opposite of blue on the color wheel" => $tc_opp_blue, 'mixing blue and orange makes what color' => $tc_mix_blue_orange, + 'mixing blue and orange makes what' => $tc_mix_blue_orange, # Invalid queries 'color' => undef, 'color ffffff' => undef,