Skip to main content

word's dictionary for several languages

Project description

MLDictionary

MLDictionary is word's dictionary for several language

>>> from mldictionary import English
>>> english_dictionary = English()
>>> snake_means = english_dictionary.get_meanings('snake')
>>> len(snake_means)
4
>>> snake_means
['a reptile with a long body and no legs: ' ...]
...

PyPI    PyPI - License    GitHub Workflow Status (event)    PyPI - Downloads


Installing MLDictionary

$ pip install mldictionary

MLDictionary officially supports 3.9+.


Some examples

>>> from mldictionary import Portuguese
>>> portuguese_dictionary = Portuguese()
>>> vida_means = portuguese_dictionary.get_meanings('vida')
>>> vida_means
['Conjunto dos hábitos e costumes de alguém; maneira de viver: tinha uma vida de milionário.' ...]
>>> from mldictionary import Spanish
>>> spanish_dictionary = Spanish()
>>> coche_means = spanish_dictionary.get_meanings('coche')
>>> coche_means
['Automóvil destinado al transporte de personas y con capacidad no superior a siete plazas.' ...]

Make your own dictionary

from mldictionary import Dictionary

class MyOwnDictionary(Dictionary):
    url = 'somedictionary.com'
    language = 'language name'
    target_tag = 'tag_where_means_is'
    target_attr = {'attr': 'attr_value'}
    replaces = {'something', 'another thing'}

>>> myowndictionary = MyOwnDictionary()
>>> myowndictionary.get_meanings('other language word')

To more details, see the wiki

Also, it has a insightful article on linkedin

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mldictionary-0.2.6.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

mldictionary-0.2.6-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page