.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Org 3pm"
.TH Org 3pm "2022-06-04" "perl v5.34.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
WWW::Dict::Leo::Org \- Interface module to dictionary dict.leo.org
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 3
\& use WWW::Dict::Leo::Org;
\& my $leo = new WWW::Dict::Leo::Org();
\& my @matches = $leo\->translate($term);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBWWW::Dict::Leo::Org\fR is a module which connects to the website
\&\fBdict.leo.org\fR 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.
.SH "OPTIONS"
.IX Header "OPTIONS"
\&\fB\fBnew()\fB\fR has several parameters, which can be supplied as a hash.
.PP
All parameters are optional.
.IP "\fI\-Host\fR" 4
.IX Item "-Host"
The hostname of the dict website to use. For the moment only dict.leo.org
is supported, which is also the default \- therefore changing the
hostname would not make much sense.
.IP "\fI\-Port\fR" 4
.IX Item "-Port"
The tcp port to use for connecting, the default is 80, you shouldn't
change it.
.IP "\fI\-UserAgent\fR" 4
.IX Item "-UserAgent"
The user-agent to send to dict.leo.org site. Currently this is the
default:
.Sp
.Vb 1
\& Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
.Ve
.IP "\fI\-Proxy\fR" 4
.IX Item "-Proxy"
Fully qualified proxy server. Specify as you would do in the well
known environment variable \fBhttp_proxy\fR, example:
.Sp
.Vb 1
\& \-Proxy => "http://192.168.1.1:3128"
.Ve
.IP "\fI\-ProxyUser\fR \fI\-ProxyPass\fR" 4
.IX Item "-ProxyUser -ProxyPass"
If your proxy requires authentication, use these parameters
to specify the credentials.
.IP "\fI\-Debug\fR" 4
.IX Item "-Debug"
If enabled (set to 1), prints a lot of debug information to
stderr, normally only required for developers or to
report bugs (see below).
.PP
Parameters to control behavior of dict.leo.org:
.IP "\fI\-Language\fR" 4
.IX Item "-Language"
Translation direction. Please note that dict.leo.org always translates
either to or from german.
.Sp
The following languages are supported: english, polish, spanish, portuguese
russian and chinese.
.Sp
You can specify only the country code, or append \fBde2\fR in order to
force translation to german, or preprend \fBde2\fR in order to translate
to the other language.
.Sp
Valid examples:
.Sp
.Vb 3
\& ru to or from russian
\& de2pl to polish
\& es2de spanish to german
.Ve
.Sp
Valid country codes:
.Sp
.Vb 7
\& en english
\& es spanish
\& fr french
\& ru russian
\& pt portuguese
\& pl polish
\& ch chinese
.Ve
.Sp
Default: \fBen\fR.
.SH "METHODS"
.IX Header "METHODS"
.SS "translate($term)"
.IX Subsection "translate($term)"
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.
.PP
.Vb 5
\& use WWW::Dict::Leo::Org;
\& use Data::Dumper;
\& my $leo = new WWW::Dict::Leo::Org();
\& my @matches = $leo\->translate("test");
\& print Dumper(\e@matches);
.Ve
.PP
which prints:
.PP
.Vb 10
\& $VAR1 = [
\& {
\& \*(Aqdata\*(Aq => [
\& {
\& \*(Aqleft\*(Aq => \*(Aqcheck\*(Aq,
\& \*(Aqright\*(Aq => \*(Aqder Test\*(Aq
\& },
\& {
\& \*(Aqleft\*(Aq => \*(Aqquiz (Amer.)\*(Aq,
\& \*(Aqright\*(Aq => \*(Aqder Test [Schule]\*(Aq
\& ],
\& \*(Aqtitle\*(Aq => \*(AqUnmittelbare Treffer\*(Aq
\& },
\& {
\& \*(Aqdata\*(Aq => [
\& {
\& \*(Aqleft\*(Aq => \*(Aqto fail a test\*(Aq,
\& \*(Aqright\*(Aq => \*(Aqeinen Test nicht bestehen\*(Aq
\& },
\& {
\& \*(Aqleft\*(Aq => \*(Aqto test\*(Aq,
\& \*(Aqright\*(Aq => \*(AqTests macheneinen Test machen\*(Aq
\& }
\& ],
\& \*(Aqtitle\*(Aq => \*(AqVerben und Verbzusammensetzungen\*(Aq
\& },
\& \*(Aqdata\*(Aq => [
\& {
\& \*(Aqleft\*(Aq => \*(Aqtesting adj.\*(Aq,
\& \*(Aqright\*(Aq => \*(Aqim Test\*(Aq
\& }
\& ],
\& \*(Aqtitle\*(Aq => \*(AqWendungen und Ausdrücke\*(Aq
\& }
\& ];
.Ve
.PP
You might take a look at the \fBleo\fR script how to process
this data.
.SS "\fBmaxsize()\fP"
.IX Subsection "maxsize()"
Returns the size of the largest returned term (left side).
.SS "\fBlines()\fP"
.IX Subsection "lines()"
Returns the number of translation results.
.SS "\fBform()\fP"
.IX Subsection "form()"
Returns the submitted form uri.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
leo
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
WWW::Dict::Leo::Org \- Copyright (c) 2007\-2017 by Thomas v.D.
.PP
\-
Copyright (c) 1995\-2016 \s-1LEO\s0 Dictionary Team.
.SH "AUTHOR"
.IX Header "AUTHOR"
Thomas v.D.
.SH "HOW TO REPORT BUGS"
.IX Header "HOW TO REPORT BUGS"
Use rt.cpan.org to report bugs, select the queue for \fBWWW::Dict::Leo::Org\fR.
.PP
Please don't forget to add debugging output!
.SH "VERSION"
.IX Header "VERSION"
.Vb 1
\& 2.01
.Ve