create_glossary: Create a Glossary with the DeepL API Pro

View source: R/create_glossary.R

create_glossaryR Documentation

Create a Glossary with the DeepL API Pro

Description

create_glossary creates a glossary for a language pair using the DeepL API Pro.

Usage

create_glossary(
  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 Pro. 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 Pro account at DeepL API Pro. The function sends a request to create a glossary and returns the result in a structured format.

References

DeepL API Documentation on Glossaries

Examples

## Not run: 
glossary_english <- c("Hello", "Goodbye")
glossary_swiss_german <- c("Grüezi", "Adiöö")
 
create_glossary(
  name = "My Glossary",
  source_lang = "en",
  target_lang = "de",
  entries_source_lang = glossary_english,
  entries_target_lang = glossary_swiss_german
)

## End(Not run)


deeplr documentation built on June 8, 2025, 12:47 p.m.