README.md

RYandexTranslate

Travis-CI Build Status Downloads cran version

R package to translate text using Yandex Translate API.

Installation

To install from CRAN repository:

install.packages("RYandexTranslate")

To install from github:

library(devtools)
install_github("mukul13/RYandexTranslate")

To get free API key, sign up here

Examples

To list all functions supported by RYandexTranslate package

library(RYandexTranslate)
ls("package:RYandexTranslate")
#>"detect_language"   "get_translation_direction"   "translate"   

To get a list of translation directions supported by the service

api_key="YOUR API KEY"
directions=get_translation_direction(api_key)
head(directions)
#>"az-ru" "be-bg" "be-cs" "be-de" "be-en" "be-es"

To detect the language of the specified text

data=detect_language(api_key,text="how are you?")
data
#>"en"

To translate text to the specified language

data=translate(api_key,text="how are you?",lang="en-hi"  )
#>$lang
#>[1] "en-hi"
#>
#>$text
#>[1] "आप कैसे हैं?"

Resources



mukul13/RYandexTranslate documentation built on Sept. 26, 2019, 2:21 p.m.