https://github.com/mldictionary/mldictionary
MLDictionary is word's dictionary for several language. Available in pypi
https://github.com/mldictionary/mldictionary
beautifulsoup4 bs4 dictionary-learning pypi-package pypi-source python webscraping
Last synced: about 1 month ago
JSON representation
MLDictionary is word's dictionary for several language. Available in pypi
- Host: GitHub
- URL: https://github.com/mldictionary/mldictionary
- Owner: mldictionary
- License: mit
- Created: 2021-06-23T16:28:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-21T22:36:42.000Z (almost 3 years ago)
- Last Synced: 2024-12-20T05:22:50.629Z (10 months ago)
- Topics: beautifulsoup4, bs4, dictionary-learning, pypi-package, pypi-source, python, webscraping
- Language: Python
- Homepage: https://pypi.org/project/mldictionary/
- Size: 74.2 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MLDictionary
## **MLDictionary** is word's dictionary for several language
```python
>>> 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**
```console
$ pip install mldictionary
```
MLDictionary officially supports 3.9+.---
## Some examples
```python
>>> 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
```python
from mldictionary import Dictionaryclass 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](https://github.com/mldictionary/mldictionary/wiki)Also, it has a insightful [article on linkedin](https://www.linkedin.com/pulse/mldictionary-pablo-em%25C3%25ADdio)