This repository contains scripts for generating flashcards for import into Mochi. Most of these are based on Gwern's scripts.
All scripts read from stdin and write their output as a CSV to stdout.
You will want to import these into a deck with no set template, since some of the flashcards have two-sides (question-answer) and some of them have one side (cloze deletions).
Given a sequence, this script generates flashcards to remember that sequence. The cards are:
- A test card that asks you to recall the entire sequence.
- A cloze card that asks you to fill one element of the sequence.
- For each element of the sequence:
- A forward card that asks you to recall the element from its position.
- A backward card that asks you to recall the position of a given element.
- A successor card that asks you what comes after a specific element.
- A predecessor card that asks you what comes before a specific element.
cat sequence.txt | ./sequence.py > output.csv
The input is plain text. The first line is the title of the sequence, the subsequent lines are the elements.
Given a greek.txt
file like this:
Greek Alphabet
Alpha
Beta
Gamma
This script will generate these flashcards:
Question | Answer |
---|---|
Greek Alphabet: Recall all elements of the sequence | Alpha, Beta, Gamma. |
Greek Alphabet: What element has position 1? | Alpha. |
Greek Alphabet: What element has position 2? | Beta. |
Greek Alphabet: What element has position 3? | Gamma. |
Greek Alphabet: What is the position of Alpha? | 1. |
Greek Alphabet: What is the position of Beta? | 2. |
Greek Alphabet: What is the position of Gamma? | 3. |
Greek Alphabet: What comes after Alpha? | Beta. |
Greek Alphabet: What comes after Beta? | Gamma. |
Greek Alphabet: What comes before Beta? | Alpha. |
Greek Alphabet: What comes before Gamma? | Beta. |
Plus the cloze card:
Cloze |
---|
Greek Alphabet: Elements of the sequence: {{Alpha}}, {{Beta}}, {{Gamma}}. |
Given a poem, this script generates flashcards where you are given some context (the previous two lines) and have to recall the next line.
cat poem.txt | ./poetry.py > output.csv
The input is plain text. The first line is the title of the sequence, the second line is the author, and subsequent lines are the poem.
Given a wasteland.txt
file like this:
Archaic Torso of Apollo
Rainer Maria Rilke
We cannot know his legendary head
with eyes like ripening fruit. And yet his torso
is still suffused with brilliance from inside,
like a lamp, in which his gaze, now turned to low,
...
This script will generate these flashcards:
Question | Answer |
---|---|
Beginning ... |
We cannot know his legendary head |
Beginning We cannot know his legendary head ... |
with eyes like ripening fruit. And yet his torso |
We cannot know his legendary head with eyes like ripening fruit. And yet his torso ... |
is still suffused with brilliance from inside, |
with eyes like ripening fruit. And yet his torso is still suffused with brilliance from inside, ... |
like a lamp, in which his gaze, now turned to low, |
And so on.
- Create a new deck (don't set a template).
- Click import, CSV, double quote as the quote character.
- Find the output file.
- Select the deck you just created.
Copyright (c) 2023 Fernando Borretti.
Released under the MIT license.