Org(3pm)

πŸ“¦
version 2.02 Β· 2 versions
  • 2.02 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 2.02 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

okay bestie, welcome to the Org(3pm) page πŸ’… this is the perl manual for WWW::Dict::Leo::Org β€” it's the interface module to the dictionary over at dict.leo.org πŸŽ€


✨ SYNOPSIS ✨

the whole vibe in three lines, no cap:

use WWW::Dict::Leo::Org;
my $leo = new WWW::Dict::Leo::Org();
my @matches = $leo->translate($term);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜•: WWW::Dict::Leo::Org is a module that connects to the website dict.leo.org and translates the term you give it. It hands back an array of hashes 🫢 and each hash has a left side and a right side of the result entry. iconic, honestly.


πŸ’– OPTIONS πŸ’–

new() has several parameters, which can be supplied as a hash. literally all of them are optional, so no pressure bestie πŸ’œ

  • -Host β€” the hostname of the dict website you wanna use. For the moment only dict.leo.org is supported, and that's also the default β€” so changing the hostname would not make much sense πŸ™ˆ like, don't.
  • -Port β€” the tcp port to use for connecting. default is 80, and you shouldn't change it. periodt.
  • -UserAgent β€” the user-agent to send to the dict.leo.org site. Currently this is the default:
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
  • -Proxy β€” fully qualified proxy server. specify it the way you would do in the well known environment variable http_proxy, like this example:
-Proxy => "http://192.168.1.1:3128"
  • -ProxyUser, -ProxyPass β€” if your proxy requires authentication, use these parameters to specify the credentials πŸ”
  • -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 πŸ‘€).

parameters to control behavior of dict.leo.org:

  • -Language β€” translation direction. ⚠️ please note that dict.leo.org always translates either to or from german β€” that's just the rules, bestie.

the following languages are supported: english, polish, spanish, portuguese russian and chinese.

you can specify only the country code, or append de2 in order to force translation to german, or prepend de2 in order to translate to the other language.

valid examples:

ru     to or from russian
de2pl  to polish
es2de  spanish to german

valid country codes:

en    english
es    spanish
fr    french
ru    russian
pt    portuguese
pl    polish
ch    chinese

default: en.


πŸ‘‘ METHODS πŸ‘‘

πŸ’« 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 🌈

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 πŸ‘€ iykyk.

πŸ’« maxsize()

returns the size of the largest returned term (left side) πŸ“

πŸ’« lines()

returns the number of translation results πŸ”’

πŸ’« form()

returns the submitted form uri 🌐


πŸŽ€ SEE ALSO πŸŽ€

leo


WWW::Dict::Leo::Org - Copyright (c) 2007-2017 by Thomas v.D.

<http://dict.leo.org/> - Copyright (c) 1995-2016 LEO Dictionary Team.


⭐ AUTHOR ⭐

Thomas v.D. <tlinden@cpan.org>


😭 HOW TO REPORT BUGS 😭

use rt.cpan.org to report bugs, select the queue for WWW::Dict::Leo::Org.

please don't forget to add debugging output! fr fr, it's giving helpful and we need it πŸ™

πŸ”₯ VERSION πŸ”₯

 2.01

and that's a wrap bestie 🫢 this was Org(3pm), shipped with perl v5.34.0 and dated 2022-06-04. slay, go translate something πŸ’–βœ¨