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: ' ...]
...
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
Release history Release notifications | RSS feed
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.3.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for mldictionary-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce0f56b4cc4bb00cb263bdcc67d67d370caef10a01a46f76edb76a7d91b6d5c8 |
|
MD5 | 2262c7029d534719448422a1dd2ef847 |
|
BLAKE2b-256 | d80696526873f4f8d2024ef56a56fd8871d501da66c53d3857824beec4523f6e |