Skip to main content

Traduttore Latino: lemma, paradigma, grammatica e traduzione da Dizionario Olivetti ©.

Project description

Latino

Latino è una libreria python che traduce dal latino usando il Dizionario Latino.

Latino is a python library that translates latin text by making requests to the Online Latin Dictionary.

Written for Python 3.8+.

pip install latino

latino.Translator

You have to create an instance of Translator to use this API

Parameters:

  • lang - language to be translated to
  • settings (available from the next releases)

translate(text, **kwargs)
Translate text from latin to destination language\

  • Parameters:
    • text (str; string sequence) - The latin source text(s) to be translated.
  • Return type: list[Translated]
  • Return type: list[list[Translated]] (when a list is passed)

Basic usage:

>>> from latino import Translator
>>> translator = Translator()  # lang="it" (italian default)

>>> # translator.translate returns a list of all possible translations
>>> puella = translator.translate("puella")[0]  # let's get the first result

>>> puella.lemma
pŭella

>>> puella.grammatica
sostantivo femminile  I declinazione

>>> puella.paradigma # might not exist
[puellă], puellae

>>> puella.traduzione
['bambina', 'ragazza', 'fanciulla', 
 'amante', 'donna amata', 'sposa', 
 'giovane donna', 'figlia', 'schiava']

>>> puella.table()
{'FEMMINILE': {'PLURALE': ['Nom.puellae',
                           'Gen.puellārum',
                           'Dat.puellis',
                           'Acc.puellas',
                           'Abl.puellis',
                           'Voc.puellae'],
               'SINGOLARE': ['Nom.puellă',
                             'Gen.puellae',
                             'Dat.puellae',
                             'Acc.puellam',
                             'Abl.puellā',
                             'Voc.puellă']}}

from latino import Translator

# Translator() takes as arg a lang between "it"/"en"/"fr"
translator = Translator("en") 

# Gonna print possible meaning for "es"
for translated in translator.translate("es"):
    print(translated.traduzione[0])
to eat
to be

from latino import Translator
translator = Translator("fr") 

text = "pulchram puellam sum"
# any string sequence such as list can also be taken as argument!
for i in translator.translate(text.split()):
    print(i[0].paradigma)
[pulcher], pulchră, pulchrum
[puellă], puellae
[sum], es, esse, fui

latino.models

latino.models.Translated

Members:

  • grammatica - grammar
  • lemma - lemma
  • paradigma - paradigm
  • traduzione - list of translations

table()
Returns the Declension table or the Conjugation table

latino.LANGUAGES

# languages which can be translated from
LANGUAGES = {
    'it': 'italiano', 
    'en': 'english', 
    'fr': 'francais'
 }

Licenza | License

MIT

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

latino-0.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

latino-0.1.1-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file latino-0.1.1.tar.gz.

File metadata

  • Download URL: latino-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for latino-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ea813fd37570fdbd312c79ef5da8df04b2be793f59151d02cd0b508e74e1fe5
MD5 e382975ff538c80e1860e2fada08d72e
BLAKE2b-256 f54e82e16477dad0fdb597830b8e5f119a0fbf50ca83394f3685e7ffd02ed189

See more details on using hashes here.

File details

Details for the file latino-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: latino-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for latino-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ab9fa06036fb9aecf1f96f327b8eb2ca7c9c5452dc3a86cfe6c31ae1bf19cb67
MD5 5531d66a4bae445687a0a6219deea2e5
BLAKE2b-256 15644182e7d7871f53b971db003aaa89df6f008c84bb0b4189b7303f66fcee7f

See more details on using hashes here.

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