MORJI_FACTS(5) File Formats Manual MORJI_FACTS(5)


morji_factsmorji 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, twoside and cloze. Facts of type oneside generate simple question/answer cards. Facts of type twoside are pairs of the form front/back and back/front, particularly useful for vocabulary for generating recognition and production cards. Facts of type cloze 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) 
@Tags: some-tag
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). The following markup commands are predefined:
em args ...
This command emphasizes arguments joined with space interleaved.
lbracket, rbracket
These commands can be used to write literal left and right square brackets.
cloze cloze-text ?hint?
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 cloze command.
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 cloze (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 twoside, 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.

Importing facts

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 new cards.


Example of fact of type oneside:
@Question: What is the word for “remember”? 
@Answer: morji 
@Type: oneside 
@Tags: lojban
This fact will generate one card with question and answer fields as expected.
Example of fact of type twoside:
@Question: rememori 
@Answer: se rappeler (quelque chose) 
@Type: twoside 
@Tags: esperanto-french
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]. 
@Type: cloze 
@Tags: euskara
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”.


morji(1), morji_config(5)
November 29, 2017 OpenBSD 6.1