baidu_translate {fanyi}R Documentation

translate

Description

Translate query sentences

Usage

baidu_translate(x, from = "en", to = "zh")

bing_translate(x, from = "en", to = "zh")

caiyun_translate(x, from = "auto", to = "zh")

chatglm_translate(x, from = "en", to = "zh")

tencent_translate(x, from = "en", to = "zh")

en2cn(x)

cn2en(x)

translate(x, from = "en", to = "zh")

volcengine_translate(x, from = "en", to = "zh")

youdao_translate(x, from = "en", to = "zh")

Arguments

x

query sentences

from

source language, i.e., the language to be translated

to

target language, i.e., the language to be translated into

Details

This function use online translator API (one of Baidu, bing, youdao, volcengine, caiyun, tencent and LLM-powered chatglm) to translate query sentences

Value

the translated sentences

Author(s)

Guangchuang Yu

Examples


baidu_translate('hello world')

library(fanyi)
## set your appid and key once in your R session
#
# set_translate_option(appid = 'your_appid', key = 'your_key', source = 'which_translation_service')
#
# translate('hello world', from = 'en', to = 'zh')

[Package fanyi version 0.0.7 Index]