Compare commits
No commits in common. "main" and "feature/create-config" have entirely different histories.
main
...
feature/cr
11
.gitignore
vendored
11
.gitignore
vendored
@ -1,11 +1,3 @@
|
|||||||
*.csv
|
|
||||||
*.pdf
|
|
||||||
*.apkg
|
|
||||||
*.anki2
|
|
||||||
*.anki
|
|
||||||
*.epub
|
|
||||||
|
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
@ -169,6 +161,3 @@ cython_debug/
|
|||||||
|
|
||||||
# Project Specific
|
# Project Specific
|
||||||
scripts/
|
scripts/
|
||||||
|
|
||||||
|
|
||||||
data/
|
|
106
README.md
106
README.md
@ -1,103 +1,23 @@
|
|||||||
# Ankimaker
|
# Ankimaker
|
||||||
|
|
||||||
|
WIP
|
||||||
|
|
||||||
A CLI app to generate anki decks.
|
A CLI app to generate anki decks.
|
||||||
|
|
||||||
Flashcards are a great tool for accelerating language learning.
|
From csv file, with configurable parameters, filters and media.
|
||||||
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
|
From epub, finding difficult* words in the book and getting their translations.
|
||||||
|
|
||||||
## csv
|
*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.
|
||||||
|
|
||||||
From csv file, with configurable parameters and
|
| Language Level | Number of Base Words Needed |
|
||||||
(media to be supported in the future).
|
| ----- | ------ |
|
||||||
|
| A1 | 500|
|
||||||
|
| A2 | 1000|
|
||||||
|
| B1 | 2000|
|
||||||
|
| B2 | 4000|
|
||||||
|
| C1 | 8000|
|
||||||
|
| C2 | 16000|
|
||||||
|
|
||||||
```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.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
filters:
|
|
||||||
- - column: 'original language'
|
|
||||||
values: Chinese
|
|
||||||
- column: 'translation language'
|
|
||||||
values: [English, French]
|
|
||||||
```
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
filters:
|
|
||||||
- - column: 'original language'
|
|
||||||
values: Chinese
|
|
||||||
- - column: 'translation language'
|
|
||||||
values: English
|
|
||||||
```
|
|
||||||
|
|
||||||
* * *
|
|
||||||
|
|
||||||
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.
|
@ -1,5 +0,0 @@
|
|||||||
from .cli import main
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
Loading…
x
Reference in New Issue
Block a user