Difference between revisions of "Wiki gloss plug-in"
(Created page with "<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> = Overview = The GLL extension provides a wiki markup element for linguistic annotations. It closely follo...") |
|||
(28 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> | <div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> | ||
= Overview = | = Overview = | ||
− | The | + | The Gloss extension provides a wiki markup element for linguistic annotations, developed for McGill Field Methods classes by [http://www.ruthsresearch.org/ Derek Ruths]. The Gloss extension automatically aligns text with glosses, as well as provides auto-numbering and hyper-referencing. It closely follows the form and features of the [http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/ Latex-based glossing tools], allowing the wiki source text to be easily pasted into Latex documents. This page provides both formal documentation of the extension as well as numerous examples of how the tool is used. |
= Installing the extension = | = Installing the extension = | ||
− | To | + | To install the extension, you must have access to the ''includes'' directory of your MediaWiki installation. The installation is a two step procedure. |
1. Copy the ''gloss.php'' file into the ''includes'' directory of your MediaWiki installation | 1. Copy the ''gloss.php'' file into the ''includes'' directory of your MediaWiki installation | ||
2. Open the ''LocalSettings.php'' file in the root directory of your MediaWiki installation. Just below the line <pre>require_once( "$IP/includes/DefaultSettings.php" );</pre> add the line <pre>require_once( "$IP/includes/gloss.php" );</pre> | 2. Open the ''LocalSettings.php'' file in the root directory of your MediaWiki installation. Just below the line <pre>require_once( "$IP/includes/DefaultSettings.php" );</pre> add the line <pre>require_once( "$IP/includes/gloss.php" );</pre> | ||
− | You should now be able to use the | + | You should now be able to use the Gloss extension in your wiki pages. |
= Using the extension = | = Using the extension = | ||
== The GL element == | == The GL element == | ||
− | The | + | The Gloss extension allows a wiki editor to automatically align text for interlinear glossing. In this extension, one phrase-gloss-translation entry is entered inside an xml-formatted element |
<pre> | <pre> | ||
<gl ...arguments...> | <gl ...arguments...> | ||
− | \gll ... | + | \gll ...text... |
− | ... gloss ... | + | ...gloss... |
− | \trans ... translation ... | + | \trans ...translation... |
</gl> | </gl> | ||
</pre> | </pre> | ||
Line 25: | Line 25: | ||
<pre> | <pre> | ||
<gl id="ex1"> | <gl id="ex1"> | ||
− | + | \gll ela'l-ul magasan-g | |
− | \gll | + | bring-1>2 store-LOC |
− | + | \trans I'm bringing you to the store. | |
− | \trans I | ||
</gl> | </gl> | ||
</pre> | </pre> | ||
which produces the following block: | which produces the following block: | ||
<gl id="ex1"> | <gl id="ex1"> | ||
− | + | \gll ela'l-ul magasan-g | |
− | \gll | + | bring-1>2 store-LOC |
− | + | \trans I'm bringing you to the store. | |
− | \trans I | + | </gl> |
+ | |||
+ | A fourth line can be added above the parsed line: | ||
+ | |||
+ | <gl id="ex2"> | ||
+ | ela'lul magasang | ||
+ | \gll ela'l-ul magasan-g | ||
+ | bring-1>2 store-LOC | ||
+ | \trans I'm bringing you to the store. | ||
</gl> | </gl> | ||
== Numbering and references == | == Numbering and references == | ||
− | Notice that the example | + | Notice that the example blocks above were automatically numbered. This number is inserted and auto-increments. As a result, the next block will receive the number 3. |
− | <gl id=" | + | <gl id="ex3"> |
− | + | \gll Piel amalga-t | |
− | + | Piel dance-3SG | |
− | \gll | + | \trans Piel dances. |
− | |||
− | \trans | ||
</gl> | </gl> | ||
Beyond giving some structure to the blocks themselves, you can easily create hyperlinked references to specific GL elements by using the GL reference element <pre><glr id="...gl element id..."/></pre>. So, we can reference the example above using | Beyond giving some structure to the blocks themselves, you can easily create hyperlinked references to specific GL elements by using the GL reference element <pre><glr id="...gl element id..."/></pre>. So, we can reference the example above using | ||
− | <pre><glr id=" | + | <pre><glr id="ex3"/></pre> |
which generates this: <glr id="ex2"/>. | which generates this: <glr id="ex2"/>. | ||
Line 61: | Line 66: | ||
== Spacing == | == Spacing == | ||
The number of spaces inserted between words in the GL element can be adjusted by using the parameter ''margin''. Thus, we can render the same content with different spacings (for readability, for example), as follows: | The number of spaces inserted between words in the GL element can be adjusted by using the parameter ''margin''. Thus, we can render the same content with different spacings (for readability, for example), as follows: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <pre> | |
− | + | <gl margin=2 id="ex4"> | |
− | <gl | + | \gll Mali newti-al-asi-t |
− | + | Mali one-around-move-3sg | |
− | \gll | + | \trans Mali wanders around alone. |
− | |||
− | \trans | ||
</gl> | </gl> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | |||
− | = | + | This produces <glr id="ex4"/>, where the margin = 2 (this is the default value): |
− | + | <gl margin=2 id="ex4"> | |
− | + | \gll Mali newti-al-asi-t | |
− | + | Mali one-around-move-3sg | |
− | + | \trans Mali wanders around alone. | |
− | < | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | \gll | ||
− | |||
− | \trans | ||
</gl> | </gl> | ||
− | = | + | In <glr id="ex5"/> the margin = 5: |
− | + | <gl margin=5 id="ex5"> | |
− | <gl | + | \gll Mali newti-al-asi-t |
− | \gll | + | Mali one-around-move-3sg |
− | + | \trans Mali wanders around alone. | |
− | \trans | ||
</gl> | </gl> | ||
− | == | + | == Font size == |
− | Here | + | The size of the font used inside of the GL element can be set using the parameter ''fontsize''. By default, the fontsize is 15. Here is the same content as above, rendered in font size 12. |
− | <gl | + | <gl fontsize=12> |
− | \gll | + | \gll Piel wenaqwie-t |
− | + | Piel jump-3SG | |
− | + | \trans Piel jumps | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | \trans | ||
</gl> | </gl> | ||
− | + | == Blank space and grammaticality marks == | |
− | <gl id=" | + | As in Latex gloss environments, curly brackets can be inserted in the gloss line in order to line up with unglossed text, such as the square brackets in <glr id="ex6"/> |
− | \gll | + | <gl id="ex6"> |
− | + | \gll Mali magwtgp [ lpa'tuj-ewei wenju'su'n ] | |
− | \trans | + | Mali eat.3sg.past {} boy-POSS apple {} |
+ | \trans Mali ate the boy's apple. | ||
</gl> | </gl> | ||
− | <gl> | + | which was created with the following input: |
− | \gll | + | <pre> |
− | + | <gl id="ex6"> | |
− | \trans | + | \gll Mali magwtgp [ lpa'tuj-ewei wenju'su'n ] |
+ | Mali eat.3SG.PST {} boy-POSS apple {} | ||
+ | \trans Mali ate the boy's apple. | ||
</gl> | </gl> | ||
+ | </pre> | ||
− | + | The same can be used to mark examples as ungrammatical or infelicitous, as in <glr id="ex7"/> | |
− | The | + | <gl id="ex7"> |
− | < | + | \gll * jinm ala mesgilg |
− | + | {} man that big | |
− | \gll | + | \trans That man is big. |
− | |||
− | \trans | ||
</gl> | </gl> | ||
− | + | created with: | |
− | + | <pre> | |
− | + | <gl id="ex7"> | |
− | + | \gll * jinm ala mesgilg | |
− | \gll | + | {} man that big |
− | + | \trans That man is big. | |
− | \trans | ||
</gl> | </gl> | ||
+ | </pre> | ||
− | + | == Known issues == | |
− | |||
− | |||
− | |||
− | |||
− | + | === Unicode string handling === | |
− | + | While the GL extension does handle unicode characters, there are some instances where it will incorrectly align strings containings rich unicode characters. When using these characters, the phrase and gloss may not perfectly line up. | |
− | |||
− | |||
− | |||
− | + | === Formatting within GL blocks === | |
− | + | Currently, it is impossible to use special formatting (e.g. boldface, italics) inside a GL block. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 18:28, 19 February 2012
Overview
The Gloss extension provides a wiki markup element for linguistic annotations, developed for McGill Field Methods classes by Derek Ruths. The Gloss extension automatically aligns text with glosses, as well as provides auto-numbering and hyper-referencing. It closely follows the form and features of the Latex-based glossing tools, allowing the wiki source text to be easily pasted into Latex documents. This page provides both formal documentation of the extension as well as numerous examples of how the tool is used.
Installing the extension
To install the extension, you must have access to the includes directory of your MediaWiki installation. The installation is a two step procedure.
1. Copy the gloss.php file into the includes directory of your MediaWiki installation
2. Open the LocalSettings.php file in the root directory of your MediaWiki installation. Just below the line
require_once( "$IP/includes/DefaultSettings.php" );
add the line
require_once( "$IP/includes/gloss.php" );
You should now be able to use the Gloss extension in your wiki pages.
Using the extension
The GL element
The Gloss extension allows a wiki editor to automatically align text for interlinear glossing. In this extension, one phrase-gloss-translation entry is entered inside an xml-formatted element
<gl ...arguments...> \gll ...text... ...gloss... \trans ...translation... </gl>
A simple example would be
<gl id="ex1"> \gll ela'l-ul magasan-g bring-1>2 store-LOC \trans I'm bringing you to the store. </gl>
which produces the following block:
ela'l-ul magasan-g bring-1>2 store-LOC
'I'm bringing you to the store.'
A fourth line can be added above the parsed line:
ela'lul magasang
ela'l-ul magasan-g bring-1>2 store-LOC
'I'm bringing you to the store.'
Numbering and references
Notice that the example blocks above were automatically numbered. This number is inserted and auto-increments. As a result, the next block will receive the number 3.
Piel amalga-t Piel dance-3SG
'Piel dances.'
Beyond giving some structure to the blocks themselves, you can easily create hyperlinked references to specific GL elements by using the GL reference element
<glr id="...gl element id..."/>
. So, we can reference the example above using
<glr id="ex3"/>
which generates this: (2).
You can reset the numbering for a given GL element by using the GL element header:
<gl renum="true"> ... </gl>
Spacing
The number of spaces inserted between words in the GL element can be adjusted by using the parameter margin. Thus, we can render the same content with different spacings (for readability, for example), as follows:
<gl margin=2 id="ex4"> \gll Mali newti-al-asi-t Mali one-around-move-3sg \trans Mali wanders around alone. </gl>
This produces (4), where the margin = 2 (this is the default value):
Mali newti-al-asi-t Mali one-around-move-3sg
'Mali wanders around alone.'
In (5) the margin = 5:
Mali newti-al-asi-t Mali one-around-move-3sg
'Mali wanders around alone.'
Font size
The size of the font used inside of the GL element can be set using the parameter fontsize. By default, the fontsize is 15. Here is the same content as above, rendered in font size 12.
Piel wenaqwie-t Piel jump-3SG
'Piel jumps'
Blank space and grammaticality marks
As in Latex gloss environments, curly brackets can be inserted in the gloss line in order to line up with unglossed text, such as the square brackets in (7)
Mali magwtgp [ lpa'tuj-ewei wenju'su'n ] Mali eat.3sg.past boy-POSS apple
'Mali ate the boy's apple.'
which was created with the following input:
<gl id="ex6"> \gll Mali magwtgp [ lpa'tuj-ewei wenju'su'n ] Mali eat.3SG.PST {} boy-POSS apple {} \trans Mali ate the boy's apple. </gl>
The same can be used to mark examples as ungrammatical or infelicitous, as in (8)
* jinm ala mesgilg man that big
'That man is big.'
created with:
<gl id="ex7"> \gll * jinm ala mesgilg {} man that big \trans That man is big. </gl>
Known issues
Unicode string handling
While the GL extension does handle unicode characters, there are some instances where it will incorrectly align strings containings rich unicode characters. When using these characters, the phrase and gloss may not perfectly line up.
Formatting within GL blocks
Currently, it is impossible to use special formatting (e.g. boldface, italics) inside a GL block.