A light-weight Python wrapper for the Latin WordNet API
Project description
Latin WordNet API
This module provides a light-weight wrapper for the Latin WordNet API.
Basic Usage
>>> from latinwordnet import LatinWordNet
>>> LWN = LatinWordNet()
>>> for lemma in LWN.index():
... print(lemma['lemma'], lemma['pos'], lemma['morpho'])
>>> uirtus = LWN.lemmas(lemma='uirtus', pos='n').get()
[{'lemma': 'uirtus', 'pos': 'n', 'morpho': 'n-s---fn3-', 'uri': '28157', 'pronunciation': '[ˈwɪr.tuːs]', 'principal_parts': 'uirtut', 'irregular_forms': '', 'alternative_forms': ''}]
>>> dicere = LWN.lemmas(lemma='dico', pos='v', morpho='v1spia--3-').get()
>>> synsets = LWN.lemmas(lemma='dico', morpho='v1spia--1-').synsets
>>> LWN.lemmas(lemma='femina', pos='n').relations)[0]['relations']
{'related-to': [{'lemma': 'femellarius', 'morpho': 'n-s---mn2-', 'uri': 'f0342'}, {'lemma': 'femella', 'morpho': 'n-s---fn1-', 'uri': 'f0341'}, {'lemma': 'femino', 'morpho': 'v1spia--1-', 'uri': 'f0348'}, {'lemma': 'feminatus', 'morpho': 'aps---mn1-', 'uri': '110520'}, {'lemma': 'femineus', 'morpho': 'aps---mn1-', 'uri': 'f0345'}, {'lemma': 'femininus', 'morpho': 'aps---mn1-', 'uri': 'f0346'}, {'lemma': 'feminine', 'morpho': 'rp--------', 'uri': '110522'}]}
>>> LWN.synsets(pos='n', offset='03316977').get()
{'pos': 'n', 'offset': '03316977', 'gloss': 'a protective structure or device (usually metal)', 'semfield': []}
>>> LWN.synsets(pos='n', offset='03316977').lemmas
[{'lemma': 'aegis', 'morpho': 'n-s---fn3-', 'uri': 'a0870'}, {'lemma': 'integumentum', 'morpho': 'n-s---nn2-', 'uri': 'i2222'}, {'lemma': 'scutum', 'morpho': 'n-s---nn2-', 'uri': 's0833'}, {'lemma': 'clipeus', 'morpho': 'n-s---mn2-', 'uri': 'c2123'} . . . ]
>>> for lemmed in LWN.lemmatize('virtutem'):
... print(lemmed)
{'lemma': {'lemma': 'uirtus', 'morpho': 'n-s---fn3-', 'uri': '28157'}, 'morpho': ['n-s---fa3-']}
>>> for translated in LWN.translate('en', 'dagger', 'n'):
... print(translated)
[{"lemma": "pugio", "morpho": "n-s---mn3-", "prosody": "pugio", "uri": "p4420"}, {"lemma": "sicula", "morpho": "n-s---fn1-", "prosody": "sicula", "uri": "s1585"}, {"lemma": "gladiolus", "morpho": "n-s---mn2-", "prosody": "gladiolus", "uri": "g0330"}]
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
latinwordnet-0.3.1.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file latinwordnet-0.3.1.tar.gz
.
File metadata
- Download URL: latinwordnet-0.3.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4aa1b4ff715abf07479d882d5f6aab38b3ab37ef72d1cb693f41d48f4456252 |
|
MD5 | fbc8c34df57704be4403a686dfcb8c4f |
|
BLAKE2b-256 | e48a57f9abae080a03fdb3ff5d168e4cd7778bc22f334a6281ac41a9f713b41c |
File details
Details for the file latinwordnet-0.3.1-py2.py3-none-any.whl
.
File metadata
- Download URL: latinwordnet-0.3.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b8578a1d96c0d42b076a62411de7e90cfdfcee0e27140e793f4e6e830ea41b |
|
MD5 | 01b5a9efaf87013ed1e91f92655cd904 |
|
BLAKE2b-256 | 85efeac91eb888af6534a15e05b721bb8dc1a0dcf19e7a0fb9bd804a7dfea3ef |