2015-11-04 14:40:33 -08:00
|
|
|
package DDG::Goodie::Lowercase;
|
|
|
|
# ABSTRACT: Convert a string into lowercase.
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use DDG::Goodie;
|
|
|
|
|
|
|
|
zci answer_type => "lowercase";
|
|
|
|
zci is_cached => 1;
|
|
|
|
|
|
|
|
triggers start => 'lowercase', 'lower case', 'lc', 'strtolower', 'tolower';
|
|
|
|
|
|
|
|
handle remainder => sub {
|
|
|
|
my $input = shift;
|
|
|
|
|
|
|
|
return unless $input;
|
|
|
|
|
|
|
|
my $lower = lc $input;
|
|
|
|
|
2015-12-13 03:04:11 -08:00
|
|
|
return if ($lower eq $input);
|
|
|
|
|
2016-05-14 14:46:41 -07:00
|
|
|
return $lower, structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => html_enc($lower),
|
|
|
|
subtitle => "Lowercase: " . html_enc($input)
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text',
|
|
|
|
}
|
|
|
|
};
|
2015-11-04 14:40:33 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
1;
|