Skip to content
Perl interface to the Google AJAX Language API
Perl
Find file
Latest commit 4f7f924 Nov 20, 2011 @hma CPAN release 0.14
Failed to load latest commit information.
lib/WebService/Google CPAN release 0.14 Nov 20, 2011
t CPAN release 0.14 Nov 20, 2011
xt CPAN release 0.14 Nov 20, 2011
.gitignore Ignore/skip MYMETA.json Nov 20, 2011
Changes CPAN release 0.14 Nov 20, 2011
MANIFEST CPAN developer release 0.12_01 Dec 23, 2010
MANIFEST.SKIP Ignore/skip MYMETA.json Nov 20, 2011
Makefile.PL CPAN release 0.14 Nov 20, 2011
README CPAN release 0.14 Nov 20, 2011

README

WebService::Google::Language
============================

WebService::Google::Language is an object-oriented interface to the
Google AJAX Language API (http://code.google.com/apis/ajaxlanguage/).

The AJAX Language API is a web service to translate and detect the language
of blocks of text.


DEPRECATION WARNING

The v1 API, which this module is based on, WILL BE SHUT OFF COMPLETELY
by Google on Dec 1, 2011.

See http://code.google.com/apis/language/translate/overview.html


SYNOPSIS

    use WebService::Google::Language;

    my $service = WebService::Google::Language->new(
      referer => 'http://example.com/',
      src     => '',
      dest    => 'en',
    );

    my $result = $service->translate('Hallo Welt');
    if ($result->error) {
      printf "Error code: %s\n", $result->code;
      printf "Message:    %s\n", $result->message;
    }
    else {
      printf "Detected language: %s\n", $result->language;
      printf "Translation:       %s\n", $result->translation;
    }

    $result = $service->detect('Bonjour tout le monde');
    printf "Detected language: %s\n", $result->language;
    printf "Is reliable:       %s\n", $result->is_reliable ? 'yes' : 'no';
    printf "Confidence:        %s\n", $result->confidence;


INSTALLATION

To install this module, run the following commands:

    perl Makefile.PL
    make
    make test
    make install


DEPENDENCIES

This module requires these other modules:

    HTTP::Response      (required by "make test")
    JSON 2.0+
    LWP::UserAgent
    Test::More 0.62+    ("make test")
    URI


DOCUMENTATION

After installing, you can find documentation for this module with
the perldoc command:

    perldoc WebService::Google::Language


COPYRIGHT AND LICENSE

Copyright (c) 2008-2011 Henning Manske. All rights reserved.

This module is free software. You can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/

This module is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Something went wrong with that request. Please try again.