Constant Noble:Leipzig.js
In Constant Noble's Tovasala Dictionary, support for interlinear text is provided by the Leipzig.js JavaScript utility. Leipzig.js, developed by B.D. Chauvette, is used in the Texts section of the Corpus of Tovasala (via the {{Interlinear}} system) as well as the language's Grammar.
Leipzig.js scans page code for instances of <div data-gloss>
, as well as CSS classes and IDs calling its functions. In its simplest implementation, the utility renders two lines of code enclosed by the HTML <p></p>
tag—the first profiling a breakdown of the Tovasala morphemes in use, and the second providing their glosses and gloss abbreviations.
For demonstration purposes, the following code (for "Hello, world!"/"Salout, maunddhé!", showcased as Corpus:Snippets/0001) will be used below:
<div data-gloss>
<p>salout {} maund -t -e</p>
<p>hello {} world -VOC -N</p>
</div>
In normal MediaWiki, this sample goes unformatted: | salout {} maund -t -e hello {} world -VOC -N |
This is the correct rendering under Leipzig.js: | salout {} maund -t -e hello {} world -VOC -N |
Note the use of single braces ({}
) between individual words in the code above, which are mandatory for Tovasala glosses per Leipzig element spacing: false
, which developer Chauvette recommends for agglutinative/synthetic languages.[1] Spaces between each Tovasala morpheme are recommended for readability reasons, and gloss abbreviations must be capitalised.
If these conditions are not followed, then undesirable output will appear:
Code | Circumstance | Output |
---|---|---|
<div data-gloss>
<p>salout maund -t -e</p>
<p>hello world -VOC -N</p>
</div>
|
Normal spacing between words and morphemes | salout maund -t -e hello world -VOC -N |
<div data-gloss>
<p>salout {} maund-t-e</p>
<p>hello {} world-VOC-N</p>
</div>
|
Connected morphemes[2] | salout {} maund-t-e hello {} world-VOC-N |
<div data-gloss>
<p>salout {} maund-t-e</p>
<p>hello {} world-voc-n</p>
</div>
|
Lowercase gloss abbreviations | salout {} maund -t -e hello {} world -voc -n |
For three-line support—where an English translation is the last one—the Dictionary uses the CSS class "ilnr-en
" ("Interlinear, English") in place of data-gloss
:
Code | Output |
---|---|
<div class="ilnr-en">
<p>salout {} maund -t -e</p>
<p>hello {} world -VOC -N</p>
<p>Hello, world!</p>
</div>
|
salout {} maund -t -e hello {} world -VOC -N Hello, world! |
The Corpus' {{Interlinear/Block}} uses four lines of interlinear data—the first containing a Tovasala phrase or sentence, the next two with morphemes and gloss, and the last the English translation—along with "ilnr-rfm-en
" ("Interlinear, Tovasala–English").
Code | Output |
---|---|
<div class="ilnr-rfm-en">
<p>Salout, maunddhé!</p>
<p>salout {} maund -t -e</p>
<p>hello {} world -VOC -N</p>
<p>Hello, world!</p>
</div>
|
Salout, maunddhé! salout {} maund -t -e hello {} world -VOC -N Hello, world! |
This design is similar to that used in the advanced interlinear tables at LACITO's Pangloss Collection, an example of which can be viewed here (in Iaai/French).
Notes and references
- ^ Chauvette, B.D. (August 4, 2015). "Leipzig.js: Documentation". GitHub. Retrieved on April 6, 2022. "The default Leipzig.js styling includes small horizontal spacing at glossed word boundaries. For highly agglutinative languages, this behavior may not be ideal, because glossed phrases are likely to contain many morphemes in one word."
- ^ Although this is the traditional widespread approach, the Tovasala documentation only recommends it for established compounds, as in this example for tepriānte (grandparent):
tep-riānt -e
grand-parent -N
External links
- Official site
- Usage examples for German, Japanese, Klingon, Nahuatl, Classical Ainu, Spanish, and Town Nyanja
- Code repository at GitHub