morji facts syntax
The morji database contains a set of facts encoding question/answer information.
Each fact can have one or more cards.
There are three types of facts: oneside
Facts of type oneside
question/answer cards. Facts of type twoside
pairs of the form front/back and back/front, particularly useful for
vocabulary for generating recognition and production cards. Facts of type
generate question/answer cards, where the
question has some text replaced by […] or a hint, and the answer
contains the replaced text.
Facts are written using the following syntax:
@Question: question text with some [em emphasis]
@Answer: answer text
@Notes: some notes
@Type: oneside (or twoside or cloze)
The @Question: field contains the question text. The text can contain markup
commands in brackets with the syntax:
[cmd args ...
. The list of arguments is a Tcl list (space
separated items). This means that braces and quotes can be used to write
arguments containing spaces. Markup commands can easily be defined in morji's
initialization file, see morji_config(5)
following markup commands are predefined:
- This command emphasizes arguments joined with space
- These commands can be used to write literal left and right
- This command is used for facts of type
cloze. The argument
cloze-text is the text that should appear
in the answer. The optional argument hint
is the text that replaces the cloze text. If no hint is provided, three
dots […] are used. It should be noted that in cloze-deletion facts,
several cloze commands can be used, resulting
in generation of several cards, one for each
The @Answer: field contains the answer text. Its syntax is the same as with the
@Question: field. This field is not used for facts of type
(answer is generated from cloze text).
The @Notes: field contains some additional notes. The syntax is the same as with
@Question: and @Answer:. It is particularly useful for facts of type
, because it allows to show in the answer
the same additional information for the two sister-cards.
The @Type: field contains the name of the type of the fact.
The @Tags: field contains a Tcl list (space separated items) of tags associated
with the fact, which can be used to organize facts by themes.
morji allows to import facts from a file. Each line is a fact and has five
tab-separated fields, in order: question, answer, notes, type, tags. The
syntax of each field is the same as with the interactive method of introducing
Example of fact of type oneside
@Question: What is the word for “remember”?
This fact will generate one card with question and answer fields as expected.
Example of fact of type twoside
@Answer: se rappeler (quelque chose)
This fact will generate two cards: one from esperanto to french, and another
from french to esperanto.
Example of fact of type cloze
@Question: Zer da lore hau? Ez dut [cloze gogoratu remember].
This fact will generate one card. The question will get the hint part of the
cloze command: “remember” (in bold between square brackets). The
answer will get the cloze part of the cloze command: “gogoratu”.