create_glossary2 creates a glossary for a language pair using the DeepL API Free.

create_glossary2(
  name,
  source_lang,
  target_lang,
  entries_source_lang,
  entries_target_lang,
  return_tibble = F,
  auth_key
)

Arguments

name

A string specifying the name to be associated with the glossary.

source_lang

A string specifying the source language code.

target_lang

A string specifying the target language code.

entries_source_lang

A character vector containing the glossary entries in the source language.

entries_target_lang

A character vector containing the glossary entries in the target language.

return_tibble

Logical. If TRUE, the returned result will be converted to a tibble.

auth_key

A string representing the authentication key for the DeepL API Free. If not provided, the function will attempt to retrieve the key from the environment variable DEEPL_API_KEY. You can set this variable using Sys.setenv(DEEPL_API_KEY = "your_key") or define it in your .Renviron file for persistent use.

Details

To use this function, you must obtain an authentication key by registering for a DeepL API Free account at DeepL API Free. The function sends a request to create a glossary and returns the result in a structured format.

Examples

if (FALSE) { # \dontrun{
glossary_english <- c("Hello", "Goodbye")
glossary_swiss_german <- c("Grüezi", "Adiöö")
 
create_glossary2(
  name = "My Glossary",
  source_lang = "en",
  target_lang = "de",
  entries_source_lang = glossary_english,
  entries_target_lang = glossary_swiss_german
)
} # }