项目作者: annygakh

项目描述 :
Create files, containing conjugations of different verbs, ready to be uploaded to Quizlet.
高级语言: Jupyter Notebook
项目地址: git://github.com/annygakh/conjugation-flashcards.git
创建时间: 2017-12-22T19:55:02Z
项目社区:https://github.com/annygakh/conjugation-flashcards

开源协议:

下载


Spanish Conjugation Flashcards

This is a python script that creates text files, containing conjugations for the spanish verbs you provided, ready to be imported into Quizlet. The conjugations are scraped from spanishdict.com

Example

Supported types as indicated in the script itself

supported_types = ['presentIndicative', 'preteritIndicative','imperfectIndicative', 'presentSubjunctive']

Contents of words.txt

  1. ganar
  2. enseñar

Running the script

python conjugation-flashcards.py words.txt

After the script runs

Several files are created, such as presentIndicative.txt,
preteritIndicative.txt, imperfectIndicative.txt, presentSubjunctive.txt.

Output of presentIndicative.txt

  1. yo ganar gano
  2. tú ganar ganas
  3. él/ella/Ud. ganar gana
  4. nosotros ganar ganamos
  5. vosotros ganar ganáis
  6. ellos/ellas/Uds. ganar ganan
  7. yo enseñar enseño
  8. tú enseñar enseñas
  9. él/ella/Ud. enseñar enseña
  10. nosotros enseñar enseñamos
  11. vosotros enseñar enseñáis
  12. ellos/ellas/Uds. enseñar enseñan

Usage

  • The words that the user wants to conjugate must be in a text file, delimited by \n.
  • The script outputs separate text files, one for each type of mood&tense.
  • All possible moods & tenses are specified in the script.
  • Each text file contains rows of the following format <pronoun> <verb in infinitive mood><tab><conjugated verb>
  • If the script is run several times, conjugations will be appended to the end, even if they are already in the file.

Installation

All the necessary packages are specified in environment.yml.

For conda users
conda env create

Development

I make changes to the jupyter notebook file, and when I am ready to commit, I run the following command to export a .py file.
jupyter nbconvert --to script conjugation-flashcards.ipynb

Todos

This was a quick script I put together, to aid me in memorizing different conjugations of spanish verbs. There are several improvements I can think of.

  • Write tests
  • Allow user to specify supported types without having to modify the python script itself
  • Allow user to exclude certain pronouns (temporary fix: use grep to remove lines containing the unneeded pronoun from the text files)