# Spanish Conjugator 馃嚜馃嚫
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Imperial-iGEM/DJANGO-Assembly-Methods/Django%20CI)
![GitHub repo size](https://img.shields.io/github/repo-size/Benedict-Carling/spanish-conjugator)
![PyPI - Downloads](https://img.shields.io/pypi/dm/spanishconjugator)
![GitHub top language](https://img.shields.io/github/languages/top/Benedict-Carling/spanish-conjugator)
![GitHub](https://img.shields.io/github/license/Benedict-Carling/spanish-conjugator)
![PyPI](https://img.shields.io/pypi/v/spanishconjugator)
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
```python
from spanishconjugator import Conjugator
imperfect_conjugation = Conjugator().conjugate('hablar','imperfect','indicative','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
```indicative, 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
### Indicative Present
```python
Conjugator().conjugate('hablar','present','indicative','yo')
>>> hablo
```
In case of indicative present, 4th param pronoun is optional.
```python
from spanishconjugator import Conjugator
present_indicative_conjugation = Conjugator().conjugate('hablar','present','indicative')
print(present_indicative_conjugation)
>>> {'el/ella/usted': 'habla', 'ellos/ellas/ustedes': 'hablan', 'tu': 'hablas', 'vosotros': 'habl脙隆is', 'yo': 'hablo', 'nosotros': 'hablamos'}
```
### Indicative Imperfect
```python
Conjugator().conjugate('hablar','imperfect','indicative','yo')
>>> hablaba
```
### Indicative Preterite
```python
Conjugator().conjugate('hablar','preterite','indicative','yo')
>>> habl茅
```
### Indicative Future
```python
Conjugator().conjugate('hablar','future','indicative','yo')
>>> hablar茅
```
### Indicative Present_Perfect
```python
Conjugator().conjugate('hablar','present_perfect','indicative','yo')
>>> he hablado
```
### Indicative Past_Anterior
```python
Conjugator().conjugate('hablar','past_anterior','indicative','yo')
>>> hube hablado
```
### Indicative Future_Perfect
```python
Conjugator().conjugate('hablar','future_perfect','indicative','yo')
>>> habr茅 hablado
```
### Conditional Simple
```python
Conjugator().conjugate('hablar','simple_conditional','conditional','yo')
>>> hablar铆a
```
### Conditional Perfect
```python
Conjugator().conjugate('hablar','perfect','conditional','yo')
>>> habr铆a hablado
```
### Imperative Afferative
```python
Conjugator().conjugate('hablar','affirmative','imperative','tu')
>>> habla
```
### Imperative Negative
```python
Conjugator().conjugate('hablar','negative','imperative','tu')
>>> hables
```
### Subjunctive Present
```python
Conjugator().conjugate('hablar','present','subjunctive','yo')
>>> hable
```
### Subjunctive Imperfect
```python
Conjugator().conjugate('hablar','imperfect','subjunctive','yo')
>>> hablara
```
### Subjunctive Imperfect_se
```python
Conjugator().conjugate('hablar','imperfect_se','subjunctive','yo')
>>> hablase
```
### Subjunctive Future
```python
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](https://github.com/Benedict-Carling/spanish-conjugator/blob/master/images/pytest.png?raw=true)
## Developing - Submission
To submit code to this repositry please fork and submit a pull request 馃殌
# Alternative Versions
Check out the Javascript npm version of the library if you are working in a node or browser enviroment
https://github.com/Benedict-Carling/spanish-conjugatorjs
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共40个文件
py:29个
txt:6个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:spanishconjugator-2.3.918.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
spanishconjugator-2.3.918.tar.gz (40个子文件)
spanishconjugator-2.3.918
MANIFEST.in 43B
PKG-INFO 6KB
src
spanishconjugator
__init__.py 102B
tenses
subjunctive
future_perfect.py 2KB
imperfect_se.py 2KB
pluperfect.py 2KB
__init__.py 0B
imperfect.py 2KB
future.py 2KB
present_perfect.py 2KB
present.py 2KB
indicative
past_perfect.py 4KB
future_perfect.py 2KB
past_anterior.py 2KB
preterite.py 4KB
__init__.py 0B
imperfect.py 4KB
future.py 3KB
present_perfect.py 4KB
present.py 5KB
imperative
negative.py 2KB
affirmative.py 2KB
__init__.py 0B
__init__.py 0B
conditional
perfect.py 2KB
simple_conditional.py 4KB
__init__.py 0B
SpanishConjugator.py 10KB
irregulars
irregular_dict.py 16KB
__init__.py 0B
spanishconjugator.egg-info
PKG-INFO 6KB
requires.txt 35B
SOURCES.txt 2KB
top_level.txt 18B
dependency_links.txt 1B
setup.cfg 38B
requirements.txt 129B
setup.py 1KB
README.md 5KB
LICENSE.txt 1KB
共 40 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- vmware workstation pro 17 linux版
- 3479521_1710042575-1.rwmod
- 安装及环境配置UMCM-2023C-ma笔记
- (完整)数据库课程设计餐厅点餐说明书-21ab6d3c8beb172ded630b1c59eef8c75ebf952c.doc
- 2023-04-06-项目笔记 - 第一百五十四阶段 - 4.4.2.152全局变量的作用域-152 -2024.06.04
- 松哥解协议松哥解协议松哥解协议松哥解协议松哥解协议
- 618节日618节日618节日
- tensorflow-gpu-2.9.1-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp39-cp39-win-amd64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功