Learn R Programming

polyglotr (version 1.5.2)

qcri_translate_text: QCRI Translate Text

Description

This function translates a text from the source language to the target language using the QCRI Multiterm API.

Usage

qcri_translate_text(text, langpair, domain, api_key = qcri_api_key())

Value

Translated text.

Arguments

text

The text to be translated. This must be URL encoded.

langpair

The source-target language pair, where source is language of the provided text and target is the language into which the text has to be translated.

domain

The domain over which the translation is tuned.

api_key

The API key associated with the user account being used. If not provided, the function will attempt to retrieve it from the QCRI_API_KEY environment variable.

Examples

Run this code
if (FALSE) {
qcri_translate_text(text = "Hello, world!",
langpair = "en-ar",
domain = "general",
api_key = "YourApiKey")
qcri_translate_text(text = "Hello, world!",
langpair = "en-ar",
domain = "general")
}

Run the code above in your browser using DataLab