Skip to content

Tomeriko96/polyglotr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8685952 · Sep 18, 2024

History

89 Commits
Mar 23, 2024
Aug 23, 2024
Dec 6, 2023
Jan 12, 2024
Sep 18, 2024
Jan 25, 2023
Aug 23, 2024
Aug 23, 2024
Mar 23, 2024
Jan 25, 2023
Jun 16, 2023
Jul 28, 2024
Aug 23, 2024
Sep 2, 2022
Sep 2, 2022
Jul 27, 2024
Aug 19, 2024
Mar 23, 2024
Jul 27, 2024
Mar 23, 2024
Sep 15, 2022
Sep 2, 2022

Repository files navigation

polyglotr

CodeFactor Codecov test coverage R-CMD-check CRAN status The diffify page for the R package polyglotr CRAN last month downloads CRAN downloads

R package to translate text.

Overview

The polyglotr package is a language translation tool for the R programming language. It provides convenient functions to translate text using different (free) translation services. This vignette will guide you through the usage of the package and demonstrate how to translate text and files in various languages.

Currently, the package has functions to communicate with the following services:

Features

To see which functions are available, please refer to the reference page of the polyglotr package. The reference page provides a comprehensive list of functions available in the package, organized by category.

Additionally, the package includes vignettes that provide more detailed information on how to use the functions in the package.

Installation

To install the package:

# The easiest way is to get polyglotr from CRAN
install.packages("polyglotr")

# Alternatively, install the development version from GitHub
# install.packages("remotes")
remotes::install_github("Tomeriko96/polyglotr")

Usage

To demonstrate the usage of the polyglotr package, let's consider an example where we translate a list of texts into multiple languages using the create_translation_table function.

texts <- c("Hello, how are you?", 
           "I love programming!", 
           "This is a test.")

languages <- c("es", 
              "fr", 
              "de")


create_translation_table(texts, languages)


#>        Original_word                     es
#> 1 Hello, how are you?     ¿Hola, cómo estás?
#> 2 I love programming! ¡Me encanta programar!
#> 3     This is a test.    Esto es una prueba.
#>                           fr                       de
#> 1 Bonjour comment allez-vous?   Hallo, wie geht's dir?
#> 2        J'adore programmer ! Ich liebe Programmieren!
#> 3              C'est un test.        Das ist ein Test.