Package 'glosario'

Title: A Multilingual Glossary
Description: A glossary of data science terms in multiple languages and usable from multiple languages.
Authors: Greg Wilson [aut, cre] , Francois Michonneau [aut] , Ian Flores Siaca [aut] , Zhian N. Kamvar [aut]
Maintainer: Greg Wilson <[email protected]>
License: MIT + file LICENSE
Version: 0.2
Built: 2024-11-18 03:53:43 UTC
Source: https://github.com/carpentries/glosario-r

Help Index


A multilingual glossary.

Description

glosario provides the infrastructure to create and read multilingual glossaries. By default, glosario providesaccess to a community-curated glossary hosted by The Carpentries.


Look up definition of term.

Description

Look up definition of term.

Usage

define(key, lang = "en", glossary = NULL, show_lang = FALSE)

Arguments

key

lookup key

lang

language for the definition

glossary

a glossary object

show_lang

should the ISO639-1 2-letter code be displayed with the definition?

Value

string containing definition


Generate anchor tag for a given term in HTML

Description

Generate anchor tag for a given term in HTML

Usage

gdef(term, text)

Arguments

term

Look-up key

text

Text to display

Value

string containing link


Get a glossary

Description

Retrive a YAML-formatted glossary from the web or locally.

Usage

get_glossary(
  url = "https://raw.githubusercontent.com/carpentries/glosario/master/glossary.yml",
  cache = tempdir()
)

Arguments

url

the url, path for the glossary or the OWNER/REPO for a GitHub repository that hosts a glossary.

cache

the local path to cache the glossary (default: tempdir())?

Details

The specification of the file is available from https://github.com/carpentries/glosario/#readme

If <OWNER/REPO> is provided to the url argument, the successful conversion into an URL that will resolve to a glossary assumes that the glossary is called glossary.yml in the repository and it lives in the branch master.x

Value

a glossary (as an R6 object)


List of languages and their iso639-1 and iso639-2 codes

Description

A dataset of the ISO 639-1 and ISO 639-2 language codes and their names in English, French, and German.

Usage

iso639

Format

A tibble with 507 rows and 7 columns:

  • iso639_1 the 2-letter code for the language

  • iso639_2 the 3-letter code for the language (the content of this column is the same as the column iso639_2_terminology)

  • iso639_2_bibliography the 3-letter code for the language using the "Bibliographic version" (also known as ISO639-2/B).

  • iso639_2_terminology the 3-letter code for the language using the "Terminology version" (also known as ISO639-2/T).

  • english_name the English name of the language

  • french_name the French name for the language

  • german_name the German name for the language

There are 21 languages that have different codes in the ISO639-2/B and ISO639-2/T codes. In general the T codes are prefered and the B codes are provided for compatibility.

Source

http://www.loc.gov/standards/iso639-2/php/code_list.php retrieved on 2020-06-19


List all the glosario terms in an RMd

Description

List all the glosario terms in an RMd

Usage

list_glosario_terms(title = NULL, type = "definitions")

Arguments

title

The table title

type

One of 'definitions' or 'reqs'


Validate Documents using Glosario Definitions

Description

Validate Documents using Glosario Definitions

Usage

validate_document(file_path)

Arguments

file_path

path to the file to be validated

Details

In case the document is not valid the function will return a warning for each term not defined and raise a final error listing the total number of terms not matched.