Skip to content

4 Table Metadata

Translation tables may contain metadata. This makes them discoverable. Programs may for example use the Liblouis function lou_findTable to find a table based on a special query of which the syntax is described below.

4.1 Syntax

Metadata must be defined in special comments within the table header. The table header is the area at the top of the file, before the first translation rule, consisting of only comments or empty lines. Any metadata within included tables is ignored.

A metadata field must be defined on its own line, starting with #+. It has the following syntax:

#+<key>: <value>

where ‘<key>’ and ‘<value>’ are sequences of one or more characters a to z, A to Z, 0 to 9, ., -, _, and in certain cases (for ‘language’ or ‘region’, see below) also *. The colon that separates the key and value may have zero or more spaces or tabs on either side.

The same key may appear multiple times in a table.

There is no restriction on which keys and values are allowed, as long as the syntax is correct. However in order to be really useful there must be some standard keys and values. A possible grammar is proposed on the wiki page Standard metadata tags.

Fields with a key of ‘language’ or ‘region’ are treated specially. They are interpreted as “extended language ranges”. This means that they have a specific syntax, and matching them to corresponding language tags in queries happens according to specific rules.

4.2 Query Syntax

A query that is passed to the lou_findTable function must have the following syntax:

<feature1> <feature2> <feature3> ...

where ‘<feature>’ is:

<key>:<value>

Features are separated by one or more spaces or tabs. No spaces are allowed around colons.