---
name: "latrine"
section: "1"
platform: "linux"
package: "latrine"
version: "0.10.2-1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/latrine"
---

# latrine(1)

drill yourself in language vocabulary

## NAME

**LaTrine** - drill yourself in language vocabulary

## SYNOPSIS

**latrine** \[*options*\] \[*dictionary*\|*path*\]

## DESCRIPTION

**LaTrine** is a curses-based **La**nguage **Tr**a**ine**r. It takes a dictionary and asks you for a word or a phrase, and you try to give the correct translation. You can choose in what direction LaTrine shall ask, and the selection of the words or phrases will depend on how often you do not know the correct translation for the respective word. This is a usual way to drill yourself in foreign language vocabulary.

LaTrine provides UTF-8 support for non-ASCII characters, as well as (currently limited) right-to-left input and output, e.g. for Hebrew and Arabic. The program features several localizations. Screenshots can be found at LaTrine's upstream homepage *http://www.godisch.de/debian/latrine/*.

In addition to this program you need an appropriate dictionary. You may write your own word list, or you can install one from the **Free Dictionaries Project** at *http://sourceforge.net/projects/freedict/*, providing dictionaries for about 50 language combinations, which should be compatible with **LaTrine**. Download and unpack them, and put the *wordlist*.dict.dz file into /usr/share/dictd/.

## OPTIONS

- *dictionary*\|*path*

  Unless there is a **dict** entry in the system-wide or user configuration file, a dictionary needs to be specified as non-option argument. See the **FILES** section below for further information.

- **-d**, **--debug**

  Turn on debug mode, which provides additional error messages and status information, which will be appended to *~/.latrine/debug.log*. Debug mode may slow down **LaTrine** considerably.

- **--dir**\[**ection**\]**=**{**0**\|**1**\|**2**\|**3**}

  Choose the initial input direction: \[\>\>\] (**0**), \[\<\>\] (**1**), \[\>\<\] (**2**), or \[\<\<\] (**3**). The direction can be switched with **F4** while **LaTrine** is running.

- **-g**, **--digraph**

  Enable the entering of digraphs. Example: Press **A \<BSP\> '** and the result will be **Á**. The following digraphs are implemented (list may be incomplete due to groff limitations):

  ```
  Á	A'			á	a'
  Ä	A:			Ä	a:
  Č	C<			č	c<
  Ď	D<			ď	d<
  É	E'			é	e'
  Í	I'			í	i'
  Ĺ	L'			ĺ	l'
  Ľ	L<			ľ	l<
  Ñ	N?			ñ	n?
  Ň	N<			ň	n<
  Ó	O'			ó	o'
  Ô	O>			ô	o>
  Ŕ	R'			ŕ	r'
  Š	S<			š	s<
  Ť	T<			ť	t<
  Ú	U'			ú	u'
  Ý	Y'			ý	y'
  Ž	Z<			ž	z<
  ¡	!I			¿	?I
  ```

- **-f**, **--force**

  Overwrite stale lock files. Use this if **LaTrine** says that it's already running but it isn't.

- **-h**, **--help**

  Display a command line summary.

- **-i**, **--ignore-case**

  Compare case-insensitively when checking a translation.

- **-1**, **--keymap1=***path*

  Use the specified *path* as keymap file. The keymap file defines keyboard input conversion for the primary input field, see the section **FILE FORMATS** below.

- **-2**, **--keymap2=***path*

  The keymap file for the secondary input field.

- **-a**, **--label=***language1***/***language2*

  The screen label for the input fields. **--help** displays the maximum length for each of them.

- **-l**, **--limit=***max*

  The number of phrases to hold in memory. **LaTrine** handles large dictionaries by loading only the *max* least-known words into the memory. When these get a higher hit rate the dictionary will be reloaded. Specify **0** to load the whole dictionary into the memory. **--help** displays the default value. See **THE WORD SELECTION ALGORITHM** section below for further information.

- **-m**, **--mode=**{**normal**\|**reverse**\|**mixed**}

  Decides, whether you will be asked for the translation of a LHS phrase (normal mode), or a RHS phrase (reversed mode), or both in mixed order. The **F3** key will cycle through these settings while **LaTrine** is running.

- **-r**, **--random=***max*

  After each input, the wordlist is kind of sorted using a special alogrithm. The next phrase is then selected by chance from the first *max* entries in this sorted list. **--help** displays the default value. *max* is less than or equal to a non-zero memory limit above. See **THE WORD SELECTION ALGORITHM** section below for further information.

- **-v**, **--version**

  Display copyright information and the program's and libraries' version numbers.

## FILES

- **/etc/latrine.conf**

  System-wide configuration, see the **FILE FORMATS** section below for further information.

- **~/.latrine/config**

  User configuration.

- **~/.latrine/debug.log**

  Debug output.

- **/usr/share/dictd/***wordlist***.dict.dz**

  Default location for dictionaries, only *wordlist* needs to be specified. If you want to use another file as dictionary, just specify its path; say **./foo** if you mean foo instead of /usr/share/dictd/foo.dict.dz.

- **~/.latrine/***wordlist***.gz**

  The user's hit statistics (so-called wordlist files).

- **~/.latrine/***wordlist***.gz.lock**

  The wordlist lock files, containing the PID of the running **LaTrine**process.

- **/usr/share/locale/\*/LC\_MESSAGES/latrine.mo**

  Localization files. Contributions for other languages are appreciated. Find the current PO template file at *http://www2.iro.umontreal.ca/~pinard/po/registry.cgi?domain=latrine*.

## FILE FORMATS

- **Configuration files**

  contain one long option per line, e.g. **mode=mixed**. Whitespace, empty lines, and lines beginning with a **#** will be ignored. In addition to the command line options there is a **dict=**{*dictionary*\|*path*} keyword, providing the task of the non-option command line argument. On the other hand, **--force**, **--help**, and **--version** may not be used in configuration files.

- **Dictionaries**

  are usually compressed, even if they do not need to be. They must be UTF-8 encoded, and have the following structure:

  ```
  language 1 phrase
  [up to 15 more lines, CR/LF will be replaced with ", "]
  spaces or tabstops, language 2 phrase
  [up to 15 more lines, CR/LF will be replaced with ", "]
  empty line(s)
  [...]
  ```

  The order of the ", "-concatenated lines above is irrelevant when checking the answer. Language 1 phrases beginning with **00-** will be ignored. Due to bad documentation of the dictd dictionary format, not all freedict dictionaries can be read. Suggestions, how to improve the parser, will be appreciated.

- **Keymap files**

  have the following structure:

  ```
  [# comments are ignored]
  one input character, tabstop, conversion character (or string)
  [...]
  ```

  To specify a **#** character, precede it with a backslash. To use the backslash itself, do the same, i.e. double it.

## THE WORD SELECTION ALGORITHM

From the dictionary a list of *limit* least-known words is read into memory. This list is alternating sorted: three times by least-known, one time by earliest last access. From the first *random* words of the sorted list, one is picked by chance. If this is one of the last three (two, one) words asked, another one is picked by chance, unless *random* is not greater than three (two, one). Using the **--debug** switch you can follow the word selection.

## SEE ALSO

- The **LaTrine** homepage

  *http://www.godisch.de/debian/latrine/*

- The Free Dictionaries Project

  *http://sourceforge.net/projects/freedict/*

## BUGS

The screen is messed up when resizing the terminal while using the **F1** key.

Automatically reloading the dictionary is not yet implemented. This becomes necessary when the hit rates of the phrases in memory change, and other phrases (not in memory) should be asked instead. You may trigger it using the **F2** key, which will save the current state and reload the dictionary thereafter. There is usually no need to do so, unless you set **--limit** very low.

Please send any bugs to \<martin@godisch.de\>. Debian users are encouraged to use the Debian Bug Tracking System at  *http://bugs.debian.org/latrine*.

## AUTHORS

**LaTrine** was written by Martin A. Godisch \<martin@godisch.de\>.

Computation of the MD5 message digest was written by Ulrich Drepper \<drepper@gnu.ai.mit.edu\> and taken from the GNU C library.

## CONTRIBUTORS

Marco Colombo (Italian localization), Matt Dunford (bugfixes), Eyüp Hakan Duran (Turkish localization), Joe Hansen (Danish localization), Eugen Hoanca (Romanian localization), Patrik Johansson (Swedish localization), Michel Robitaille (French localization), Andhika Padmawan (Indonesian localization), Kevin Patrick Scannell (Irish localization), Benno Schulenberg (Dutch localization), Clytie Siddall (Vietnamese localization), Michał Trzebiatowski (Polish localization), Julie Vermeersch (Dutch localization), Ji ZhengYu (Chinese localization).
