WWW::Dict::Leo::Org
Interface module to dictionary dict.leo.org
- Provided by: libwww-dict-leo-org-perl (Version: 1.40-1)
- Report a bug
Interface module to dictionary dict.leo.org
use WWW::Dict::Leo::Org; my $leo = new WWW::Dict::Leo::Org(); my @matches = $leo->translate($term);
WWW::Dict::Leo::Org is a module which connects to the website dict.leo.org and translates the given term. It returns an array of hashes. Each hash contains a left side and a right side of the result entry.
new() has several parameters, which can be supplied as a hash.
All parameters are optional.
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
-Proxy => "http://192.168.1.1:3128"
Parameters to control behavior of dict.leo.org:
Default: turned on.
Possible values: on, off.
Default: standard.
Possible values: standard, none, forcedAll.
Default: relaxed.
Possible values: fuzzy, exact, relaxed.
Use this method after initialization to connect to dict.leo.org and translate the given term. It returns an array of hashes containing the actual results.
use WWW::Dict::Leo::Org;
use Data::Dumper;
my $leo = new WWW::Dict::Leo::Org();
my @matches = $leo->translate("test");
print Dumper(\@matches);
which prints:
$VAR1 = [
{
'data' => [
{
'left' => 'check',
'right' => 'der Test'
},
{
'left' => 'quiz (Amer.)',
'right' => 'der Test [Schule]'
],
'title' => 'Unmittelbare Treffer'
},
{
'data' => [
{
'left' => 'to fail a test',
'right' => 'einen Test nicht bestehen'
},
{
'left' => 'to test',
'right' => 'Tests macheneinen Test machen'
}
],
'title' => 'Verben und Verbzusammensetzungen'
},
'data' => [
{
'left' => 'testing adj.',
'right' => 'im Test'
}
],
'title' => 'Wendungen und Ausdrücke'
}
];
You might take a look at the leo script how to process this data.
Returns the size of the largest returned term (left side).
Returns the number of translation results.
Returns the submitted form uri.
leo
WWW::Dict::Leo::Org - Copyright (c) 2007-2016 by Thomas v.D.
<http://dict.leo.org/> - Copyright (c) 1995-2016 LEO Dictionary Team.
Thomas v.D. <tlinden@cpan.org>
Use rt.cpan.org to report bugs, select the queue for WWW::Dict::Leo::Org.
Please don't forget to add debugging output!
1.40