# A tibble: 5 × 6
original parsed trans…¹ label langu…² source
<chr> <chr> <chr> <chr> <chr> <chr>
1 Mér er heitt/kalt "\\te… I am h… feel… Icelan… Einar…
2 Hace calor/frío "make… It is … amb-… Spanish Puste…
3 Ik heb het koud "\\te… I am c… feel… Dutch Ross …
4 Kotae-nagara otousan to okaasan wa honobo… "repl… While … hear… Japane… Shind…
5 Ainiku sonna shumi wa nai. Tsumetai-none.… "unfo… Unfort… lang… Japane… Shind…
# … with abbreviated variable names ¹translation, ²language
Interlinear glosses
Seventh assignment
The goal of this assignment is to practice writing interlinear glosses with the glossr package.
1 Instructions
Create a branch for the assignment, e.g.
glossr
. You will work here and only move your changes tomain
if and when you want to submit.Create a Quarto document (don’t forget to remove its content!).
Reproduce the examples in the glossr documentation, paying attention to the points described in Section 2.
Render your Quarto document into the output of your choice (word, html, pdf…).
Stage and commit all the relevant files (see Cheatsheet if you don’t remember how).
Merge the changes into your
main
branch (see Cheatsheet).Push the changes to the remote.
Send me an e-mail so I check if it went ok (I will not check your repository if you don’t inform me).
2 Tips
- You can either use your own glosses, if you have examples in different languages in mind, or use the dataset that comes with glossr.
Create a dataframe (it can be a file that you open or a tibble you create in your document) with one line per example and one column per line of your interlinear gloss. The free translation has to be in a column called translation
and the unique label of the example (for cross-references) in a column called label
. Other columns can have any other name1 and all that matters is the order. For example, if you have only one other column, your glosses will have one line with that text and one with the translation, without alignment. If you have two other columns, the text in the first column and the text in the second column will be aligned based on spaces, and the translation will be added without alignment afterwards. See examples in the documentation.
glossr comes with a small dataframe used for examples, which is available as glosses
once you load the package:
-
In a hidden chunk (with
include: false
), set up glossr:Call
library(glossr)
.Call
use_glossr()
.Call
gloss_factory()
on your dataset and assign it to a variable, which will be a function to print glosses. Thegloss_factory()
call also gives you some information about how your dataset will be read, so you can print it in the console to check everything is ok.
```{r}
#| label: glossr-setup
#| include: false
library(glossr)
use_glossr()
<- gloss_factory(glosses, ignore_columns = "language")
by_label ```
- Use
by_label("gloss-label")
in a chunk withecho: false
to print the gloss with the “gloss-label” label, and`r gloss("gloss-label")`
inline to cross-reference it. You may also follow instructions on the glossr documentation to print several glosses one after the other.
`r gloss("heartwarming-jp")` illustrates a metaphorical use
Example
of Japanese *atatakai* 'warm'.
```{r}
#| label: heartwarming
#| echo: false
by_label("heartwarming-jp")
```
Example (1) illustrates a metaphorical use of Japanese atatakai ‘warm’.
-
Shindo 2015:660
Kotae-nagara otousan to okaasan wa honobonoto atatakai2 mono ni tsutsum-areru kimochi ga shi-ta.
reply-while father and mother TOP heartwarming warm thing with surround-PASS feeling NOM do-PST
“While replying (to your question), Father and Mother felt like they were surrounded by something heart warming.”
- You may also use styling options to edit the style of your glosses.
3 Git workflow
git status # check that you're on main, nothing to commit...
git branch glossr
git checkout glossr
# work on your .qmd file, render
git status # check everything is fine
git add .
git commit -m "practice with glossr"
git checkout main
git status # check everything is fine. New files should not be there
git merge glossr
# Now the .qmd file, the rendered file and the help files should be present
git push
# and send me a message!
Footnotes
If you have a column called
source
it will have a special location too, though.↩︎