as_gloss {glossr}R Documentation

Helper to create gloss objects

Description

Based on a character vectors and up to three label arguments, create an object where those arguments are attributes. These are:

Usage

as_gloss(
  ...,
  source = NULL,
  translation = NULL,
  label = NULL,
  trans_quotes = config$trans_quotes,
  output_format = config$output,
  numbering = config$numbering
)

Arguments

...

Lines for glossing

source

(Optional) Source of example

translation

(Optional) Free translation

label

(Optional) Example label

trans_quotes

(Optional) Quotes to surround the free translation with.

output_format

(Optional) Whether it will use latex, word or html format.

numbering

(Optional) Whether the gloss should be numbered (in Word and HTML).

Value

Object of class gloss, ready to be printed based on the chosen output format, and with a gloss_data object as data attribute (or, in the case of calls via gloss_df(), the original input asdata).

Examples

ex_sp <- "Un ejemplo en espaƱol"
ex_gloss <- "DET.M.SG example in Spanish"
ex_trans <- "An example in Spanish"
my_gloss <- as_gloss(ex_sp, ex_gloss, translation = ex_trans, label="ex1")

# check the gloss data
attr(my_gloss, "data")

[Package glossr version 0.8.0 Index]