Honden: A Flashcard System Built on Oboeta
This is a collection of scripts built on top of [Oboeta], my minimalistic flashcard system. All cards are stored as plain UTF-8 text in flat files: associated media files are stored in subdirectories.
Open a terminal, navigate to the directory containing Honden's source code, and execute the
install.sh script, passing the directory where you want to install the scripts as the first parameter. The installation script will also create the proper directory hierarchy if it isn't already present; see the next section for more information about the directory hierarchy.
$ ./install.sh ~/flashcards
will copy the scripts to
~/flashcards and create subdirectories if necessary. You might have to change users (e.g., run
sudo) depending on which installation directory you select.
The Directory Hierarchy
. is the root directory of a Honden installation, the directory hierarchy looks like this:
./ backups/ This directory contains backup archives created by backupall and backupcards. These are bzipped TARs (.tar.bz2). decks/ This directory contains plain text flashcard deck and log files. Deck files have a .txt extension and log files have a .log extension. Deck and log files are associated by name. For example, a deck named kanji.txt would have a log file named kanji.log. media/ recordings/ flashcards/ ロー/ This directory contains recordings of flashcards. Each recording's name is the integral ID of the associated flashcard followed by the .wav extension. If there are multiple recordings for a single flashcard, then the first one is named as just mentioned, whereas subsequent recordings' names are the flashcard's unique ID followed by ".N", where N is the recording's zero-based index, and the .wav extension. sds/ This directory contains Chinese character stroke order diagrams. Each file's name is the character that the file describes followed by an image extension. Right now, all of my diagrams are PNGs. other/ This directory contains miscellaneous data. Honden ignores it.
Most of the scripts use the Bourne shell (
sh) and the standard
awk (actually, some rely on
sort utilities. All of them should be easy to understand: Open them with your favorite text editor to check them out. Here's a high-level overview of the most important ones:
backupcardsback up all files and just cards and the scripts, respectively, to the
carddategenerates a timestamp suitable for use in flashcards.
logdategenerates a timestamp suitable for use in logs.
edeckedits the specified deck with your favorite text editor, whereas
seedeckjust views it via
newdeckcreates a new deck and associated log file using
nextidscans all decks and log files for the next unique integral flashcard ID.
genlineis a handy script that appends new cards generated from its parameters to the specified deck. It automatically generates the cards' unique IDs and adds blank rubi annotations for kanji (Chinese) characters via
reviewsomeis the driver behind
reviewkanji. It uses SM-2 to select flashcards from the specified deck and sets up a local HTTP server on port 1337 to review them. It requires a "filter program" to transform
oboeta's output into suitable lines for
oboetahttp. Honden has two filters,
filtersentences, for kanji decks and Japanese sentence decks, respectively.
reviewsentencesset all of this up for you assuming that you have decks named "kanji" and "sentences".
seesomeis identical to
reviewsomebut does not log review results.
NOTE: Some of the Japanese-specific scripts depend on Hinomoto, a small collection of programs for parsing and tagging Unicode text. Of course, you can remove these dependencies.
All of the files in this collection have been dedicated to the public domain via the Creative Commons CC0 Public Domain Dedication in the hope that they would be circulated widely and without restriction. I won't make any money from this code and I feel that it's more important that other people are free to use, modify, and distribute it as they please, with or without charge, even if I could make money from this. Simply put, I like contributing to a healthy public domain. See the file
COPYING for a complete copy of the public domain dedication.
I wrote these scripts by myself primarily for myself, but I hope that others will find them useful.
-- Joodan Van (伴上段), 2012年11月22日