abo-abo / pamparam

Simple and fast flashcards for Emacs
229 stars 16 forks source link

Spaced repetition is an algorithm for learning and repeating cards. Cards for which you get high scores get scheduled for repetition much further into the future than those with low scores. This means you spend less time repeating things that are easy for you to remember and more time on things which are hard for you to remember.

  1. Open =pamparam/doc/sets/capitals/capitals.org= and call =pamparam-sync=.

    You get a message like =35 new cards, 0 updated, 35 total= and the file =pampile.org= is opened.

  2. Call =pamparam-drill=.

    You get two buffers. One buffer, named e.g. =pam-2017-04-23.org= is your schedule file. It holds 10 cards that you should do today. The other buffer is a card asking you the capital of e.g. =Estonia=.

  3. Enter =Tallinn.= (the dot at the end starts the card validation)

    Since the answer is correct, you get a score of 5 (best one). Alternatively, if you reveal the answer with ~S-TAB~ and enter =Tallinn.=, you will get only a score of 3. Finally, if you enter a wrong answer, you get a score of 0.

  4. Theoretically, you can stop here with 1/10 cards done. Resume at any later stage with =pamparam-drill=. Or press ~n~ (calls =pamparam-drill=) to select the next card. Any cards scheduled today but not finished will carry over to tomorrow.

Assuming you finished all 10 cards, what's next?

With this example, let's get the terminology out of the way:

** Master file example A master file is an Org-mode file with things you want to learn.

One simple example is provided in [[file:doc/sets/capitals/capitals.org][capitals.org]].

Here's another, slightly more elaborate, example, which I use for learning Dutch:

+begin_src org

, Cards :cards: , comic story het stripverhal , The Adventures of Tintin is a world famous Belgian comic strip. De Avonturen van Kuifje is een wereldbekend Belgisch stripverhaal.

,** singer de zanger de zangeres ,*** The singer is only known in Belgium. De zangeres is alleen in België bekend.

+end_src

The format of the master file is fairly straightforward:

  1. There needs to be one or more card sources - first level outlines marked with the =:cards:= tag. A separate card file will be created for every second or third level child of each card source. In the example above, four cards will be created.

  2. For each second or third level outline, the heading name is the question and the heading body is the answer. I usually put e.g. a noun or a verb into the second level, and a more elaborate example of using that noun or a verb into the child third level. I also like to organize the words by generation rules and thematically, so that e.g. =honest= will be close to =modest= and very close to =honesty=.

    The only hard and enforced requirement is that all heading names must be unique.

  3. If a word has many correct possibilities (like =de zanger= and =de zangeres= both mean =singer=), I put each on its own line. This allows to enter either synonym during validation.

The master file is a great summary of the info that you have available. It's easy to search and organize.

One more option is to put all cards as level one headings. In that case, instead of tagging them with =:cards:=, you can add to the top of the file:

+begin_example

+PROPERTY: pamparam t

+end_example

** Card file example A card file looks like this:

+begin_src org

, m ,#+STARTUP: content , scores | <2017-04-23> | 3 | | , stats (setq ease-factor 2.360000) (setq intervals '(1)) , Slovenia Ljubljana

+end_src

The first heading holds all the metadata, like:

The second heading's name is the card's front, the question. The second heading's body is the anwer, it starts out hidden.

** Card scoring | score | meaning | |-------+---------------------------------------------------------------------------| | 5 | perfect answer, body hidden | | 4 | wrong answer, pamparam-card-redo was called, followed by a perfect answer | | 3 | perfect answer, body revealed | | 0 | wrong answer |

On the first try, you can get either a 5 or a 3 or a 0. Unless you get a 5, you have to =REVIEW= the card today.

You can use =pamparam-card-redo= if you make a mechanical typo and get a 0, even though you knew the card. If you manage to correct the typo, you get a 4. You can make use of ~C-y~ to yank your previous answer.

In the =REVIEW= stage, entering the answer with body revealed is acceptable to move it to =DONE=. Still, you might want to try to keep the body hidden.

** Commands and key bindings Certain commands are applicable only in certain types of files. There are 3 types of files, all of which use =org-mode=: master, card and schedule.

*** Card file Global bindings: | . | pamparam-card-validate-maybe |

Local bindings (only active if your point is at a heading start), in order of importance: | n | pamparam-drill | | q | bury-buffer | | R | pamparam-card-redo | | D | pamparam-card-delete |

*** Master file | pamparam-sync |

*** Anywhere in the repo | pamparam-drill | | pamparam-pull | | pamparam-commit |

+begin_src elisp

(setq pamparam-alist '(("/home/oleh/Dropbox/org/wiki/dutch.org" . "/home/oleh/Dropbox/source/site-lisp/git/dutch.pam")))

+end_src

=pamparam-drill= doesn't know where your repos are located. It can only determine if the current buffer's file belongs to a repo or not. In case it does, the current repo is used. Otherwise, the default repo is used which is pointed to by =pamparam-path=.

By default, =pamparam-path= points to the repo of the provided example master file. Here's my custom setting:

+begin_src elisp

(setq pamparam-path "/home/oleh/Dropbox/source/site-lisp/git/dutch.pam")

+end_src

Finally, you can have all key bindings in one place with a hydra:

+begin_src elisp

(global-set-key (kbd "C-c m") 'hydra-pam/body)

+end_src