1 Introduction

The list of abbreviations is an obligatory part of linguistic articles that nobody reads. These lists contain definitions of abbreviations used in the article (e.g. the names of corpora or sign languages), but also a list of linguistic glosses — abbreviations used in interlinear glossed examples. There is a document proposing standardized glossing rules (Comrie, Haspelmath, and Bickel 2008), which ends with a list of 84 standard abbreviations. A much bigger list of standard abbreviations is present on Wikipedia. However, researchers can deviate from the proposed abbreviations and use their own instead.

The following list of abbreviations, which I came across in a published article, makes it clear that there is room for improvement in compiling such lists:

NOM = nominative, GEN = nominative, DAT = nominative, ACC = accusative, VOC = accusative, LOC = accusative, INS = accusative, PL = plural, SG = singular

Besides the obvious errors, this list contains more problems that I would like to point out:

  • the lack of alphabetic order;
  • some abbreviations used in the article (sbjv, imp) are absent in the list.

The main goal of the lingglosses R package is to provide an option for creating:

  • interlinear glossed linguistic glosses for an .html output of rmarkdown [Xie, Allaire, and Grolemund (2018)]1;
  • a semi-automatically compiled list of glosses.

You can install the stable version of the package from CRAN:

install.packages("lingglosses")

You can also install the development version of lingglosses from GitHub with:

# install.packages("remotes")
remotes::install_github("agricolamz/lingglosses")

In order to use the package you need to load it with the library() call:

library(lingglosses)

You can go through the examples in this tutorial or you can create a lingglosses example from the rmarkdown template (File > New File > R Markdown… > From Template > lingglosses Document).

2 Create glossed examples with gloss_example()

2.1 Basic usage

The main function of the lingglosses package is gloss_example(). This package has the following arguments:

  • transliteration;
  • glosses;
  • free_translation;
  • comment;
  • grammaticality;
  • annotation2;
  • line_length.

All arguments except the last one are self-explanatory.

gloss_example(transliteration = "bur-e-**ri** c'in-ne-sːu-w",
              glosses = "fly-NPST-**INF** know-HAB-NEG-M",
              free_translation = "I cannot fly. (Zilo Andi, East Caucasian)",
              comment = "(lit. do not know how to)",
              annotation = "Бурери цIиннессу.",
              grammaticality = "*")
Бурери цIиннессу.
bur-e-ri c’in-ne-sːu-w
fly-npst-inf know-hab-neg-m
(lit. do not know how to)
‘I cannot fly. (Zilo Andi, East Caucasian)’

In this first example you can see that:

  • the transliteration line is italic by default (if you do not want it, just add the argument italic_transliteration = FALSE)3;
  • you can use standard markdown syntax (e.g. **a** for bold);
  • the free translation line is automatically framed with quotation marks.

Since the function arguments’ names are optional in R, users can omit them as long as they follow the order of the arguments (you can always find the correct order in ?gloss_example):

gloss_example("bur-e-**ri** c'in-ne-sːu-w",
              "fly-NPST-**INF** know-HAB-NEG-M",
              "I cannot fly. (Zilo Andi, East Caucasian)",
              "(lit. do not know how to)",
              "Бурери цIиннессу.",
              "*")
Бурери цIиннессу.
bur-e-ri c’in-ne-sːu-w
fly-npst-inf know-hab-neg-m
(lit. do not know how to)
‘I cannot fly. (Zilo Andi, East Caucasian)’

It is possible to number and call your examples using the standard rmarkdown tool for generating lists (@):

(@) my first example
(@) my second example
(@) my third example

renders as:

  1. my first example
  2. my second example
  3. my third example

In order to reference examples in the text you need to give them names:

(@my_ex) example for referencing
  1. example for referencing

With the names settled you can reference the example (4) in the text using the following code (@my_ex).

So this kind of example referencing can be used with lingglosses examples like in (5) and (6). The only important details are:

  • change your code chunk argument to echo = FALSE (or specify it for all code chunks with the following comand in the begining of the document knitr::opts_chunk$set(echo = FALSE"));
  • do not put an empty line between the reference line (with (@...)) and the code chunk with lingglosses code.
  1. bur-e-ri c’in-ne-sːu
    fly-npst-inf know-hab-neg
    (lit. do not know how to)
    ‘I cannot fly. (Zilo Andi, East Caucasian)’
  2. Zilo Andi, East Caucasian
    bur-e-ri c’in-ne-sːu
    fly-npst-inf know-hab-neg
    (lit. do not know how to)
    ‘I cannot fly.’

Sometimes people gloss morpheme by morpheme (this is especially useful for polysynthetic languages). It is also possible in lingglosses. You can annotate slots with the annotation argument, see footnote 2 for the details.

  1. Abaza, West Caucasian (Arkadiev and Lander 2020: example 5.2)
gloss_example("s- z- á- la- nəq'wa -wa -dzə -j -ɕa -t'",
              "1SG.ABS POT 3SG.N.IO LOC pass IPF LOC 3SG.M.IO seem(AOR) DCL",
              "It seemed to him that I would be able to pass there.")
s- z- á- la- nəq’wa -wa -dzə -j -ɕa -t’
1sg.abs pot 3sg.n.io loc pass ipf loc 3sg.m.io seem(aor) dcl
‘It seemed to him that I would be able to pass there.’

The glossing extraction algorithm implemented in lingglosses is case sensitive, so if you want to escape it you can use curly brackets:

  1. Kvankhidatli Andi, (Verhees 2019: 203)
gloss_example("den=no he.ʃː-qi hartʃ'on-k'o w-uʁi w-uk'o.",
              "{I}=ADD DEM.M-INS watch-CVB M-stand.AOR M-be.AOR",
              "And I stood there, watching him.")
den=no he.ʃː-qi hartʃ’on-k’o w-uʁi w-uk’o.
I=add dem.m-ins watch-cvb m-stand.aor m-be.aor
‘And I stood there, watching him.’

In the example above {I} is just the English word I that will be escaped and will not appear in the gloss list as marker of class I.

It make sense to avoid to use single quotes for the quotation, since it can cause some troubles for the package’s functions and use escape slash for quotations, like in the following example:

  1. Kunbzang Japhug, (Jacques 2021: 1143)
gloss_example("\"a-pi ɲɯ-ɕpaʁ-a\" ti ɲɯ-ŋu",
              "1SG.POSS-elder.sibling SENS-be.thirsty-1SG say:FACT SENS-be",
              "She said: \"Sister, I am thirsty.\"")
“a-pi ɲɯ-ɕpaʁ-a” ti ɲɯ-ŋu
1sg.poss-elder.sibling sens-be.thirsty-1sg say:fact sens-be
‘She said: “Sister, I am thirsty.”’

After a while I was asked to make it possible to add sole line examples:

gloss_example("Learn to value yourself, which means: to fight for your happiness. (Ayn Rand)",
              line_length = 100)
Learn to value yourself, which means: to fight for your happiness. (Ayn Rand)

2.2 Multiline examples

Sometimes examples are too long and do not fit onto the page. In that case you need to add the argument results='asis' to your chunk. gloss_example() will then automatically split your example into multiple rows.

  1. Mishlesh Tsakhur, East Caucasian (Maisak and Tatevosov 2007: 386)
gloss_example('za-s jaːluʁ **wo-b** **qa-b-ɨ**; turs-ubɨ qal-es-di ǯiqj-eː jaːluʁ-**o-b** **qa-b-ɨ**', 
               '1SG.OBL-DAT shawl.3 AUX-3 PRF-3-bring.PFV woolen_sock-PL NPL.bring-PL-A.OBL place-IN shawl.3-AUX-3 PRF-3-bring.PFV',
               '(they) **brought** me a shawl; instead of (lit. in place of bringing) woolen socks, (they) **brought** a shawl.',
               '(Woolen socks are considered to be more valuable than a shawl.)')
za-s jaːluʁ wo-b qa-b-ɨ; turs-ubɨ qal-es-di
1sg.obl-dat shawl.3 aux-3 prf-3-bring.pfv woolen_sock-pl npl.bring-pl-a.obl
ǯiqj-eː jaːluʁ-o-b qa-b-ɨ
place-in shawl.3-aux-3 prf-3-bring.pfv
(Woolen socks are considered to be more valuable than a shawl.)
‘(they) brought me a shawl; instead of (lit. in place of bringing) woolen socks, (they) brought a shawl.’

If you are not satisfied with the result of the automatic split you can change the value of the line_length argument (the default value is 70, that means 70 characters of the longest line).

2.3 Add audio and video

It is possible to add a soundtrack to the example using an audio_path argument. It can be both: a path to the file or an URL.

  1. Abaza, West Caucasian (my field recording)
gloss_example("á-ɕa",
              "DEF-brother",
              "This brother",
              audio_path = "abaza_brother.wav")
á-ɕa
def-brother
‘This brother’

You can hear the recording if you click on the note icon above. If you do not like the icon, you can change it to any text using an audio_label argument.

Adding video is also possible:

  1. Ukrainian Sign Language (video from https://www.spreadthesign.com)
gloss_example("PIECE",
              "piece",
              video_path = "USL_piece.mp4")
PIECE
piece