Posts Tagged ‘dictionary’

DLPO scraping

Thursday, May 1st, 2008

I’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:

  1. mahound@magrathea ~ $ dlpo português
  2. * adj.,
  3.          - relativo a Portugal;
  4.          - diz-se de uma variedade de trigo-mole;
  5. * do Lat. portucalense
  6. * s. m.,
  7.          - indivíduo natural de Portugal;
  8.          - indivíduo que tem nacionalidade portuguesa;
  9.          - língua falada pelos Portugueses, Brasileiros e todos os povos africanos de língua oficial portuguesa;
  10.          - antiga moeda de ouro.
  11. * fig.,
  12.          - franco, leal, apesar de rude;
  13. mahound@magrathea ~ $