Skip to main content

A python library to conjugate spanish words with parameters tense, mood and pronoun

Project description

Spanish Conjugator 🇪🇸

GitHub Workflow Status GitHub repo size PyPI - Downloads GitHub top language GitHub

A class Conjugator containing a function conjugate which conjugates spanish verbs by tense, mood and pronoun.

Installation

pip install spanishconjugator

Example usage

Example python usage; the conjugate function of the Conjugator Class takes 4 parameters being root-verb, tense, mood, pronoun respectively

from spanishconjugator import Conjugator
imperfect_conjugation = Conjugator().conjugate('hablar','imperfect','indicitive','yo')
print(imperfect_conjugation)
>>> hablaba

Tenses, Moods and Pronouns implemented

All pronouns are implemented yo, tu, usted, nosotros, vosotros, ustedes

All moods currently implemented are indicitive, conditional

All tenses currently implemented are present, imperfect, preterite, future, present_perfect, past_anterior, future_perfect, conditional_simple

Exaple usage of different moods/tenses with hablar and yo

Indicitive Present

Conjugator().conjugate('hablar','present','indicitive','yo')
>>> hablo

Indicitive Imperfect

Conjugator().conjugate('hablar','imperfect','indicitive','yo')
>>> hablaba

Indicitive Preterite

Conjugator().conjugate('hablar','preterite','indicitive','yo')
>>> hablé

Indicitive Future

Conjugator().conjugate('hablar','future','indicitive','yo')
>>> hablaré

Indicitive Present_Perfect

Conjugator().conjugate('hablar','present_perfect','indicitive','yo')
>>> he hablado

Indicitive Past_Anterior

Conjugator().conjugate('hablar','past_anterior','indicitive','yo')
>>> hube hablado

Indicitive Future_Perfect

Conjugator().conjugate('hablar','future_perfect','indicitive','yo')
>>> habré hablado

Conditional Simple

Conjugator().conjugate('hablar','simple_conditional','conditional','yo')
>>> hablaría

Conditional Perfect

Conjugator().conjugate('hablar','perfect','conditional','yo')
>>> habría hablado

Imperitive Afferative

Conjugator().conjugate('hablar','affirmative','imperitive','tu')
>>> habla

Imperitive Negative

Conjugator().conjugate('hablar','negative','imperitive','tu')
>>> hables

Subjunctive Present

Conjugator().conjugate('hablar','present','subjunctive','yo')
>>> hable

Subjunctive Imperfect

Conjugator().conjugate('hablar','imperfect','subjunctive','yo')
>>> hablara

Subjunctive Imperfect_se

Conjugator().conjugate('hablar','imperfect_se','subjunctive','yo')
>>> hablase

Subjunctive Future

Conjugator().conjugate('hablar','future','subjunctive','yo')
>>> hablare

Developing

if you would like to help develop spanishconjugator, follow succeeding code

Whilst in command line create a folder in which you would like to work (name only reccommended)

$ mkdir spanish_conjugator_enviroment

change directory into the enviroment you have just made

$ cd spanish_conjugator_enviroment

install virtualenv

$ pip install virtualenv

create a virtual enviroment from path of python3

$ virtualenv -p $(which python3) my_venv

activate virtual enviroment

$ source my_venv/bin/activate

tip: once you want to disactivate your virtual enviroment simply run $ deactivate

Clone Spanish-Conjugator

$ git clone https://github.com/Benedict-Carling/spanish-conjugator.git

Install developer dependencies for unit test e.g pytest and for other library tools

pip install -e .[dev]

Developing - Testing

We have chosen to use the library pytest for our unit test At this point in the developing guide you can check the code works by running it against out current unit tests located in the /tests folder

$ pytest

output should show the different tenses implemented should pass their unit tests as below.(27/08/2020) alt text

Developing - Submission

to submit code to this repositry please fork and submit a pull request 🚀

Project details


Download files

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

Files for spanishconjugator, version 2.3.1
Filename, size File type Python version Upload date Hashes
Filename, size spanishconjugator-2.3.1-py2-none-any.whl (19.2 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size spanishconjugator-2.3.1.tar.gz (9.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page