Skip to content

Latest commit

 

History

History
125 lines (90 loc) · 4.51 KB

README.org

File metadata and controls

125 lines (90 loc) · 4.51 KB

Leaf

Leaf is a flashcard app that uses spaced repetition algorithm. Leaf focuses on simplifying database management, ease of access and support for various spaced repetition curves (including custom).

https://gitlab.com/ap4y/leaf/raw/master/screenshot.png

Getting started

Leaf is a golang application and you are going to need golang toolchain to compile the app.

To install or update run:

go get -u github.com/ap4y/leaf/cmd/leaf

or

go get -u github.com/ap4y/leaf/cmd/leaf-server

Leaf provides 2 different versions:

  • leaf is a command line utility that provides review UI in the terminal
  • leaf-server is a web app that implements review UI along with additional features like stats viewer.

Both utilities have following configuration options:

  • -decks . is a path to a folder with deck files.
  • -db leaf.db is a location of a stats DB that contains spaced repetition variables for your decks.

For leaf-server you can also adjust address to start server on via -addr :8000.

Terminal CLI (leaf) has following commands:

  • review will initiate review session for a deck
  • stats will return stats snapshots for a deck

Both commands expect deck name after the command name. Full example:

./leaf -decks ./fixtures review Hiragana

Database management

Leaf uses plain text files structured usin org-mode headlines. Consider following file:

* Sample
:PROPERTIES:
:RATER:      auto
:ALGORITHM:  sm2+c
:PER_REVIEW: 20
:SIDES:      answer
:END:
** Question 1
Answer 1
** Question 2
Answer 2

Such file will be parsed as a deck named Sample and it will have 2 cards. For a full deck example check hiragana deck.

You can use text formatting, images, links and code blocks in your deck files. Check org-mode deck for an overview of supported options.

Top header level property drawer is used to adjust review parameters. Following parameters are supported:

  • ALGORITHM is a spaced repetition algorithm to use. Default is sm2+c. All possible values can be found here.
  • RATER defines which rating system will be used for reviews. Defaults to auto, supported values: auto and self.
  • PER_REVIEW is a maximum amount of cards per review session.
  • SIDES is an optional field that defines names of the card sides, used in the UI for placeholders.

Spaced repetition variables are stored in a separate file in a binary database. You can edit deck files at any time and changes will be automatically reflected in the web app.

Spaced repetition algorithms

Leaf implements multiple spaced repetition algorithms and allows you to define new ones. Following algorithms are supported as of now:

You can find calculated intervals in corresponding test files. Check SRSAlgorithm interface to define a new algorithm or curve.

Please keep in mind that algorithm variables may not be compatible with each other and algorithm switching is not supported.

Review rating

All reviews are rated using [0..1] scale. Rating higher than 0.6 will mark review as successful. You can use 2 different types of rating systems:

  • auto (default) is based on amount of mistakes made during review. For auto rating is assigned using HarshRater which implements steep curve and a single mistake will have score less than 0.6. Check Rater interface to get understanding how to define a different rater curve.
  • self is a self assessment system. You have to assign score for each review and score will be converted to a rating as such: hard = 0.2, good = 0.6, easy = 1.0, again will push card back into the review queue.

To change rating system for a deck define org-mode property RATER in your deck file.