Title: | Interlinear Glossed Linguistic Examples and Abbreviation Lists Generation |
---|---|
Description: | Helps to render interlinear glossed linguistic examples in html 'rmarkdown' documents and then semi-automatically compiles the list of glosses at the end of the document. It also provides a database of linguistic glosses. |
Authors: | George Moroz [aut, cre] |
Maintainer: | George Moroz <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.9 |
Built: | 2024-11-10 03:20:34 UTC |
Source: | https://github.com/agricolamz/lingglosses |
Adds glosses to the glosses list and adds small capitals to glosses. Escapes strings that begins and ends with curly brackets.
add_gloss(glosses)
add_gloss(glosses)
glosses |
character vector with glosses in upper case. |
vector of small capitalized glosses (if string is in the upper case) and not glosses (if string is not in the upper case)
George Moroz <[email protected]>
add_gloss(c("ABS", "ERG"))
add_gloss(c("ABS", "ERG"))
Converts example to a data.frame and adds it to the database of Interlinear-Glossed examples.
convert_to_df( transliteration, glosses, free_translation = "", comment = "", annotation = NULL, drop_transliteration = FALSE, write_to_db = TRUE, counter = getOption("lingglosses.example_counter") )
convert_to_df( transliteration, glosses, free_translation = "", comment = "", annotation = NULL, drop_transliteration = FALSE, write_to_db = TRUE, counter = getOption("lingglosses.example_counter") )
transliteration |
character vector of the length one for the transliteration line. |
glosses |
character vector of the length one for the glosses line. |
free_translation |
character vector of the length one for the free translation line. |
comment |
character vector of the length one for the comment line (under the free translation line). |
annotation |
character vector of the length one for the annotation line (above translation). |
drop_transliteration |
logical variable that denotes, whether user wants to have an example without transliteration. |
write_to_db |
logical variable that denotes, whether example should be added to the example database. |
counter |
double, value that denotes example id. By default gathered automatically through hidden variables in the Rmd document. |
dataframe with
George Moroz <[email protected]>
Reads database of interlinear examples collected through the whole document.
get_examples_db()
get_examples_db()
a dataframe with all interlinear examples from rmarkdown document.
George Moroz <[email protected]>
Creates an interlinear glossed example for linguistics.
gloss_example( transliteration, glosses, free_translation = "", comment = "", annotation = NULL, grammaticality = NULL, audio_path = NULL, audio_label = "♪", video_path = NULL, video_width = 320, video_height = 240, line_length = 70, italic_transliteration = getOption("lingglosses.italic_transliteration"), drop_transliteration = FALSE, intext = FALSE, write_to_db = TRUE )
gloss_example( transliteration, glosses, free_translation = "", comment = "", annotation = NULL, grammaticality = NULL, audio_path = NULL, audio_label = "♪", video_path = NULL, video_width = 320, video_height = 240, line_length = 70, italic_transliteration = getOption("lingglosses.italic_transliteration"), drop_transliteration = FALSE, intext = FALSE, write_to_db = TRUE )
transliteration |
character vector of the length one for the transliteration line. |
glosses |
character vector of the length one for the glosses line. |
free_translation |
character vector of the length one for the free translation line. |
comment |
character vector of the length one for the comment line (under the free translation line). |
annotation |
character vector of the length one for the annotation line (above translation). |
grammaticality |
character vector with the grammaticality value. |
audio_path |
character string with the path to the sound in .wav format. |
audio_label |
character string for the label to display. |
video_path |
character string with the path to the video. |
video_width |
width argument for the video in px. |
video_height |
height argument for the video in px. |
line_length |
integer vector of the length one that denotes maximum number of characters per one line. |
italic_transliteration |
logical variable that denotes, whether user wants to italicize your example. |
drop_transliteration |
logical variable that denotes, whether user wants to have an example without transliteration. |
intext |
logical variable that denotes, whether example should be considered as part of the text ( |
write_to_db |
logical variable that denotes, whether example should be added to the example database. |
html/latex output(s) with glossed examples.
George Moroz <[email protected]>
gloss_example("bur-e-**ri** c'in-ne-s:u", "fly-NPST-**INF** know-HAB-NEG", "I cannot fly. (Zilo Andi, East Caucasian)", grammaticality = "*", comment = "(lit. do not know how to)") gloss_example("bur-e-**ri** c'in-ne-s:u", "fly-NPST-**INF** know-HAB-NEG", "I cannot fly.", intext = TRUE)
gloss_example("bur-e-**ri** c'in-ne-s:u", "fly-NPST-**INF** know-HAB-NEG", "I cannot fly. (Zilo Andi, East Caucasian)", grammaticality = "*", comment = "(lit. do not know how to)") gloss_example("bur-e-**ri** c'in-ne-s:u", "fly-NPST-**INF** know-HAB-NEG", "I cannot fly.", intext = TRUE)
A dataset contains the list of glosses from the Leipzig Glossing Rules by Comrie, Haspelmath, and Bickel and other glosses automatically gathered from Glossa Journal articles.
glosses_df
glosses_df
A data frame with 1342 rows and 4 variables:
the gloss abbreviation
the gloss definition
the gloss source. Three possible values: Leipzig Glossing Rules, Wikipedia or lingglosses (this means parsed from Glossa).
glossa weight used for the choice in case of multiple definitions per gloss.
Creates a gloss list based on glosses used in gloss_example
. This function tries to guess the meaning of used glosses based on some internal database or database provided by user. You shouldn't treat result as carved in stone: you can copy, modify and paste in your markdown document. If you want your glossing list to be created automatically with make_gloss_list
you can compile your own table in the definition_source
argument.
make_gloss_list( definition_source = lingglosses::glosses_df, remove_glosses = "", all_possible_variants = FALSE, annotate_problematic = TRUE )
make_gloss_list( definition_source = lingglosses::glosses_df, remove_glosses = "", all_possible_variants = FALSE, annotate_problematic = TRUE )
definition_source |
dataframe with the columns |
remove_glosses |
character vector that contains glosses that should be removed from the abbreviation list. |
all_possible_variants |
logical. Some glosses have multiple definitions. |
annotate_problematic |
logical. Whether emphasize duplicated and definitionless glosses |
a string with glosses and their definitions gathered from definition_source
table.
George Moroz <[email protected]>