Bing::Translate - Class for using the functions, provided by the Microsoft Bing Translate API.
version 0.003
use Bing::Translate; my $srcText = "胖達人昨起受理退費"; my $translator = Bing::Translate->new('Your client id', 'Your client secret'); my $result = $translator->translate("$srcText", "zh-CHT", "en"); print "$result\n";
This is an implementation of the Microsoft Translator (Bing Translator) API.
This is the constructor. Options are as follows:
Client ID (required)
Your Application client ID on the Windows Azure Marketplace
Client secret (required)
Your Application client secret on the Windows Azure Marketplace
If you don't know how to do this, you can see : http://blogs.msdn.com/b/translation/p/gettingstarted1.aspx
my $result = $translator->translate("$srcText", "zh-CHT", "en");
This method reads source text and send to Bing translate server, it process the Access Token then get the translated result. The language code reference : http://msdn.microsoft.com/en-us/library/hh456380.aspx
Meng-Jie Wang <taiwanwolf.iphone@gmail.com>
This software is copyright (c) 2013 by Meng-Jie Wang.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '"胖達人昨起受理退費";'. Assuming UTF-8
To install Bing::Translate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bing::Translate
CPAN shell
perl -MCPAN -e shell install Bing::Translate
For more information on module installation, please visit the detailed CPAN module installation guide.