DLPO scraping
Thursday, May 1st, 2008I’ve put up a code snippet that can be used as a shell script, in order to consult the DLPO (portuguese) dictionary. It’s a simple HTML scraping (html5lib + BeautifulSoup) example, but it’s really useful (at least for me).
Example:
-
mahound@magrathea ~ $ dlpo português
-
* adj.,
-
- relativo a Portugal;
-
- diz-se de uma variedade de trigo-mole;
-
* do Lat. portucalense
-
* s. m.,
-
- indivíduo natural de Portugal;
-
- indivíduo que tem nacionalidade portuguesa;
-
- língua falada pelos Portugueses, Brasileiros e todos os povos africanos de língua oficial portuguesa;
-
- antiga moeda de ouro.
-
* fig.,
-
- franco, leal, apesar de rude;
-
mahound@magrathea ~ $