LEO(1p)

πŸ“¦
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

πŸ‘‘ leo(1p) β€” the group chat ✨

okay bestie, gather round πŸ’– this is leo, and she's a commandline interface to http://dict.leo.org/ β€” the German/English/French dictionary situation. she lives in the User Contributed Perl Documentation section, hence the 1p πŸ’…


🌸 SYNOPSIS 🌸

leo [-slmcfuphdv] [<term>]

that's it. that's the whole vibe.


✨ DESCRIPTION ✨

so leo is a commandline interface to the german/english/french dictionary over at http://dict.leo.org/. she supports almost all the features the website supports, plus more. main character energy fr fr πŸ’…

results get printed to the terminal. by default, the key word you searched gets highlighted (you can turn that off, keep reading bestie).

and because waiting is not the vibe, leo can cache queries if you keep running the same one over and over. obsessed. πŸŽ€

leo acts as a standard webbrowser, just like your mozilla or what so ever does β€” she connects to the website, executes the query, parses the HTML result, and finally prints it somewhat nicely formatted to the terminal. lowkey iconic.

as of this writing, leo acts as:

Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

(yeah she's cosplaying a Firefox from 2007, don't perceive her 🫢)


πŸ¦‹ OPTIONS πŸ¦‹

  • -s, --spelltolerance β€” allow spelling errors. your typos are valid, bestie 😭

possible values: standard, on or off.

default setting: standard.

  • -m, --morphology β€” hand over the morphology info.

possible values: standard, none or forcedAll.

default setting: standard.

  • -c, --chartolerance β€” allow umlaut alternatives.

possible values: fuzzy, exact or relaxed.

default: relaxed.

  • -l, --language β€” translation direction. and heads up: dict.leo.org always translates either to or from german. no exceptions, that's just the rules πŸ’€

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.

  • -n, --noescapechars β€” don't use escapes for highlighting. so no glow-up for the search term, sad but valid πŸ₯²

default: do highlighting.

controllable via config file too. see below.

no highlighting will be used if STDOUT is not connected to a terminal.

  • -f, --force β€” don't use the query cache. fresh query, no leftovers 🧚

default: use the cache.

this option has no effect if use_cache is turned off in the config file.

  • -u, --user β€” specify the http proxy user to use if your proxy requires authentication. read the 'PROXY' section for more details.
  • -p, --passwd β€” specify the cleartext password to use with http proxy authentication.
this is not recommended and just implemented for completeness. like, seriously, not the move 😭
  • -h, --help β€” display this help and exit.
  • -v, --version β€” display version information and exit.
  • -d, --debug β€” enable debugging output (a lot of it, beware!), which will be printed to STDERR. if you find a bug you must supply the debugging output along with your bugreport. no debug output, no bug report, periodt.

term is the key word which you want to translate. if the term contains white spaces, quote it using double quotes.

if the term parameter is not specified, leo will read it from STDIN.


πŸŽ€ CONFIG πŸŽ€

leo reads a config file .leo in your home directory if it exists. the following variables are supported:

  • use_latin β€” turns on conversion of UTF8 characters to their latin* encoding.

default setting (if not given): yes.

  • use_cache β€” controls the use of the cache (see later).

possible values: yes or no.

default setting (if not given): yes.

if the commandline option -f or --force has been set then the cache will not be used for the query and if for this query exists an entry in the cache it will be removed from it.

  • use_color β€” controls the use of escape sequences in the terminal output to highlight the key-waord in the result.

possible values: yes or no.

default setting (if not given): yes.

you can set this option via commandline too: -n or --noescapechars.

the config option has higher precedence.

  • user_agent β€” you may modify the user agent as leo identifies itself on the target site. the default is:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.3.1; X11)

πŸ’– CACHING πŸ’–

leo supports caching of queries for faster results if you repeatedly use the same query. a query consists of the given term (the key word or string) plus the translation option settings. so it's a whole package deal, not just the term 🫢

if you, for example, execute once the following query:

% leo langnase

and somewhere later:

% leo -c exact

then leo will treat the latter query as a different one than the previous one, because dict.leo.org behaves different when different translation options are given. no cap.


🌈 PROXY 🌈

leo can be used with a HTTP proxy service. for this to work, you only have to set the environment variable http_proxy. it has the following format:

PROTO://[USER:PASSWD@]SERVER[:PORT]

the only supported protocol is http. if your proxy works without authentication, you can omit the user:passwd part. if no port is specified, 80 will be used.

here is an example (for bash):

export http_proxy=http://172.16.120.120:3128

and an example with authentication credentials:

export http_proxy=http://max:34dwe2@172.16.120.120:3128
as security is always important, I have to warn you, that other users on the same machine can read your environment using the ps -e .. command, so this is not recommended. πŸ’€

the most secure way for proxy authentication is just to specify the server+port with http_proxy but no credentials, and instead use the -u commandline parameter to specify a user (do not use -p to specify the password, this will also be readable in process listing). in this case, leo will ask you interactively for the password. she will try her best to hide it from being displayed when you type it (as most such routines in other tools do it as well), if this fails (e.g. because you do not have the stty tool installed), the password will be read from STDIN. slay for trying though πŸ’…


πŸ“ FILES πŸ“

~/.leo             the config file for leo. Not required.
~/.leo-CACHE.db*   the cache file.

πŸ’œ AUTHOR πŸ’œ

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


⭐ BUGS ⭐

leo depends on http://dict.leo.org/. it may break leo if they change something on the site. therefore be so kind and inform me if you encounter some weird behavior of leo. in most cases it is not a bug of leo itself, it is a website change on http://dict.leo.org/. it's giving "don't shoot the messenger" 😭

in such a case repeat the failed query and use the commandline flag -d (which enables debugging) and send the full output to me, thanks. 🫢


leo copyleft 2000-2017 Thomas v.D.. All rights reserved.

http://dict.leo.org/ copyright (c) 1995-2017 LEO Dictionary Team.

the search results returned by leo are based on the work of the people at LEO.org. thanks for the great work. πŸ‘‘

some time ago they told me that they are disagreed with leo, or in other words: from their point of view leo seems to break copyright law in some or another way.

I thought a long time about this, but I must deny this. leo acts as a simple web client, just like mozilla, IE or even lynx are doing. they are providing the service to the public so I use my favorite web browser to make use of it. in fact my favorite browser to view dict.leo.org is leo. there is nothing wrong with that. IMHO. ✨

if you disagree or are asked by the LEO team to stop using leo you may decide this for yourself. I in my case wrote kinda browser, what is not prohibited. at least not today. πŸ’…


🧚 VERSION 🧚

this is the manpage for leo version 2.01.


and that's the whole page bestie, no notes πŸ’– this lil manual came to you from the perl v5.34.0 era, dated 2022-06-04 β€” go forth and translate, you absolute icon πŸ¦‹βœ¨πŸŽ€