zeroclickinfo-goodies/lib/DDG/Goodie/Unidecode.pm

29 lines
774 B
Perl
Raw Normal View History

2012-04-15 12:41:23 -07:00
package DDG::Goodie::Unidecode;
# ABSTRACT: return an ASCII version of the search query
use DDG::Goodie;
use Text::Unidecode;
2012-11-06 14:48:08 -08:00
use utf8;
2012-04-15 12:41:23 -07:00
triggers startend => "unidecode";
zci is_cached => 1;
zci answer_type => "convert_to_ascii";
2012-11-06 13:22:27 -08:00
attribution github => ['https://github.com/moritz', 'moritz'];
2012-11-06 14:48:08 -08:00
primary_example_queries 'unidecode møæp';
secondary_example_queries "unidecode å亰";
2012-11-06 13:22:27 -08:00
description 'decode special non-latin characters';
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Unidecode.pm';
2012-11-06 14:48:08 -08:00
category 'computing_tools';
2012-11-06 13:22:27 -08:00
topics 'programming';
2012-04-15 12:41:23 -07:00
handle remainder => sub {
my $u = unidecode $_;
# unidecode output sometimes contains trailing spaces
$u =~ s/\s+$//;
return $u;
};
1;