2014-10-28 11:34:36 -07:00
|
|
|
package DDG::Goodie::Unidecode;
|
|
|
|
# ABSTRACT: return an ASCII version of the search query
|
|
|
|
|
2015-02-22 12:09:29 -08:00
|
|
|
use strict;
|
2014-10-28 11:34:36 -07:00
|
|
|
use DDG::Goodie;
|
|
|
|
use Text::Unidecode;
|
|
|
|
use utf8;
|
|
|
|
|
|
|
|
triggers startend => "unidecode";
|
|
|
|
|
|
|
|
zci is_cached => 1;
|
|
|
|
zci answer_type => "convert_to_ascii";
|
|
|
|
|
2015-01-07 10:24:47 -08:00
|
|
|
attribution github => ['moritz', 'Moritz Lenz'];
|
2014-10-28 11:34:36 -07:00
|
|
|
primary_example_queries 'unidecode møæp';
|
|
|
|
secondary_example_queries "unidecode å亰";
|
|
|
|
description 'decode special non-latin characters';
|
|
|
|
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Unidecode.pm';
|
|
|
|
category 'computing_tools';
|
|
|
|
topics 'programming';
|
|
|
|
|
|
|
|
handle remainder => sub {
|
|
|
|
my $u = unidecode $_;
|
|
|
|
# unidecode output sometimes contains trailing spaces
|
|
|
|
$u =~ s/\s+$//;
|
|
|
|
return $u;
|
|
|
|
};
|
|
|
|
|
|
|
|
1;
|