gabriel becker
2 years ago
1 changed files with 93 additions and 13 deletions
@ -1,23 +1,103 @@ |
|||||||
# Ankimaker |
# Ankimaker |
||||||
|
|
||||||
WIP |
|
||||||
|
|
||||||
A CLI app to generate anki decks. |
A CLI app to generate anki decks. |
||||||
|
|
||||||
From csv file, with configurable parameters, filters and media. |
Flashcards are a great tool for accelerating language learning. |
||||||
|
You can choose one from the many databases out there, developed |
||||||
|
by teachers and very conscientious people. It would be even better |
||||||
|
it is easy to create new flashcards to satisfy personalized needs. |
||||||
|
For instance, generating flashcards from your bookmarked words in |
||||||
|
google translator or dictionary add-on on your browser |
||||||
|
would be much more effective because you would focus in the words |
||||||
|
you actually are not familiar with including the ones that are more |
||||||
|
frequent in your professional or hobby contexts than in default |
||||||
|
common language use. |
||||||
|
|
||||||
|
# Usage |
||||||
|
|
||||||
|
## csv |
||||||
|
|
||||||
|
From csv file, with configurable parameters and |
||||||
|
(media to be supported in the future). |
||||||
|
|
||||||
|
```bash |
||||||
|
ankimaker csv -i file.csv -o deck.apkg --conf conf.yaml |
||||||
|
``` |
||||||
|
|
||||||
|
#### Configuration File |
||||||
|
The configuration file required to convert csv can be |
||||||
|
generated manually or interactively with the following command: |
||||||
|
```bash |
||||||
|
ankimaker make-csv-config -i sample-input.csv -o custon-conf.yaml |
||||||
|
``` |
||||||
|
|
||||||
|
If you want to create the configuration manually, see instruction |
||||||
|
in `Manually create configuration file` section. |
||||||
|
|
||||||
|
## Manually create configuration file |
||||||
|
```yaml |
||||||
|
AnkimakerConfig: |
||||||
|
header: |
||||||
|
question_column: 'original' |
||||||
|
answer_column: 'translation' |
||||||
|
separators: \t |
||||||
|
filters: |
||||||
|
- - column: 'original language' |
||||||
|
values: Chinese |
||||||
|
- column: 'translation language' |
||||||
|
values: English |
||||||
|
- - column: 'original language' |
||||||
|
values: English |
||||||
|
- column: 'translation language' |
||||||
|
values: Chinese |
||||||
|
``` |
||||||
|
|
||||||
|
Explaining the fields: |
||||||
|
* **header**: Row index to be used as column. Use null |
||||||
|
if nonexistent or just don't insert this field. |
||||||
|
* **question_column**: Name or index of column to be used as question. |
||||||
|
* **answer_column**: Name or index of the columns containing the answers. . Use null |
||||||
|
if nonexistent or just don't insert this field. |
||||||
|
* **separators**: Select the character that separates cells in your csv. |
||||||
|
* **filters**: This is a list of groups that will be present in your |
||||||
|
final deck. Each group is defined by a list of rules that must be fulfilled |
||||||
|
so the row will be part of the group. For instance, the following filter |
||||||
|
would keep only the rows whose 'original language' column value |
||||||
|
is Chinese. |
||||||
|
|
||||||
|
```yaml |
||||||
|
filters: |
||||||
|
- - column: 'original language' |
||||||
|
values: Chinese |
||||||
|
``` |
||||||
|
|
||||||
|
This other filer would keep only the rows that 'original language' |
||||||
|
column is Chinese and 'translation language' column value is |
||||||
|
any of English or French. |
||||||
|
|
||||||
From epub, finding difficult* words in the book and getting their translations. |
```yaml |
||||||
|
filters: |
||||||
|
- - column: 'original language' |
||||||
|
values: Chinese |
||||||
|
- column: 'translation language' |
||||||
|
values: [English, French] |
||||||
|
``` |
||||||
|
|
||||||
*I still don't know what 'difficult' will mean. Probably difficult words will be less frequent words that are more frequent in the text than in some corpus, cut above a grade threshold. The grades will map percentiles of frequency. |
The logic of the groups is that any row satisfying at least |
||||||
|
one group's rule will be present in the final deck. In short, |
||||||
|
they're reduced with `or` logic. In the example bellow any row |
||||||
|
that has 'original language' column value Chinese and any roll |
||||||
|
that has 'translation language' column value English will be |
||||||
|
in the final deck. |
||||||
|
|
||||||
| Language Level | Number of Base Words Needed | |
```yaml |
||||||
| ----- | ------ | |
filters: |
||||||
| A1 | 500| |
- - column: 'original language' |
||||||
| A2 | 1000| |
values: Chinese |
||||||
| B1 | 2000| |
- - column: 'translation language' |
||||||
| B2 | 4000| |
values: English |
||||||
| C1 | 8000| |
``` |
||||||
| C2 | 16000| |
|
||||||
|
|
||||||
|
* * * |
||||||
|
|
||||||
This project is only possible because of the awesome work of genanki team. |
This project is only possible because of the awesome work of genanki team. |
Loading…
Reference in new issue