| CPAN Ratings Lingua-Translate-Google reviews | |
| Home | Search | About | Bitcard Account | Login |
RSS | Module Info | Add a review of Lingua-Translate-Google
Lingua::Translate::Google offers a "Google translate" (machine translation) backend to the existing "Lingua::Translate" module, which interacts with online translation services.
Just for fun, here is an example which translates the review just below this one on the cpanratings front page into English:
#!/home/ben/software/install/bin/perl
use warnings;
use strict;
use Encode qw/decode_utf8/;
use HTML::Entities;
use Lingua::Translate;
use LWP::Simple;
my $text = get 'cpanratings.perl.org/user/iakuf';
if ($text =~ /<blockquote class="review">(.+?)<\/blockquote>/s) {
$text = decode_entities ($1);
$text = decode_utf8 ($text);
Lingua::Translate::config (back_end => 'Google',format => 'text',);
my $xl8r = Lingua::Translate->new (src => 'zh-CN', dest => 'en');
print $xl8r->translate($text), "\n";
}
(Contact me at bkb@cpan.org if you have a comment about this review.)
Ben Bullock - 2010-06-29T21:05:01
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|