cyberme0w's Cat logo 🐾MEOW🐾

dudencli/cliberam - online dictionaries from your terminal

Recently I’ve been having issues remembering certain words in German and Portuguese, as I don’t necessarily use them on a daily basis. My solution to this problem until now has essentially been:

  1. try to remember
  2. struggle
  3. mentally spiral down, feeling like I am loosing any semblance of language-based identity, as well as regret for not using my mother-tongues more often
  4. look up the word in an online dictionary

At some point, having to open a browser, then enter the dictionary’s name, then enter the search term, then wait for the page to load, etc, became a bit tedious. So I wrote two short scripts (one for each language) that do all of that for me, then spit out the data I am looking for. Of course, there are also offline dictionaries for this kind of thing, but then I wouldn’t have a reason to write another post here.

dudencli scrapes https://duden.de/rechtschreibung, the online version of the classic Duden dictionaries. This is specially useful to me, because I sometimes forget what gender some less-common words have, as well as their correct spelling. The website also provides some other useful data that I don’t really use, such as synonyms, etymology, and grammatical notes. Below you can see a short comparison of both the online dictionary as well as dudencli’s output:

Duden Online’s results for the search term ‘Test’
dudencli‘s results for the search term ’Test’

Similarly, cliberam uses https://dicionario.priberam.org/, a high quality portuguese online dictionary. One thing I would still like to add would be an option to fetch the conjugations if available. But until then, this is what the script returns:

Priberam’s results for the search term ‘esparguete’
cliberam‘s results for the search term ’esparguete’

This goes without saying, but none of this is sanctioned by either Duden or Priberam, so while I hope they can see it for what it is - a project intended to make using their services easier and more accessible, motivated by a student’s passion for scripting - I am at the mercy of their lawyers.

Please don’t sue me (-‿-“)

As usual, the scripts are available on codeberg (dudencli, cliberam) under GPLv3, so feel free to steal them (terms and conditions apply).