Translate English Sentence into Chinese, or Translate Chinese Sentence into English

If translate English or Chinese sentence, there is a faster way for R user. You can pass in an English or Chinese sentence, ecce package support both English and Chinese translation. It also support browse translation results in website. In addition, also support obtain the pinyin of the Chinese character, you can more easily understand the pronunciation of the Chinese character.


ecce

ecce offers some functions which translate English sentence into Chinese, or translate Chinese sentence into English. Learn more in vignette("ecce") or help(package = "ecce"). You can visit https://cxy.cc/rproj/ecce/ for the latest information.

Installation

# Install development version via GitHub
remotes::install_github("chuxinyuan/ecce")
# Install from CRAN
install.packages("ecce")

Configure the ID and PASSWORD for the Youdao API

To use the ecce package, user need to first register with the Youdao Wisdom Cloud AI open platform, and then open the text translation application. Then put your Youdao API ID and PASSWORD in the following code and run it once.

cat(
  '\n# ID and PASSWORD of Youdao Translation',
  'app_key = "Your Youdao API ID"',
  'app_secret = "Your Youdao API PASSWORD"',
  file = '~/.Renviron', sep = '\n', append = TRUE
)

Usage

Get started with pass a Chinese or English sentence into the translation function. In addition, also support obtain the pinyin of the Chinese character, so that you can more easily understand the pronunciation of the Chinese character.

# Example-1
translate("我喜欢中国")

# Example-2
translate("I like China")

# Example-3
translate_view("我喜欢中国")

# Example-4
translate_view("I like China")

# Example-5
pinyin("时间序列模型")

License

ecce is free and open source software, licensed under MIT + file LICENSE.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ecce")

3.0.3 by Xinyuan Chu, 2 years ago


https://cxy.cc/rproj/ecce/, https://github.com/chuxinyuan/ecce


Report a bug at https://github.com/chuxinyuan/ecce/issues


Browse source code at https://github.com/cran/ecce


Authors: Xinyuan Chu [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports curl, uuid, digest, httr, jsonlite

Suggests testthat, knitr, rmarkdown


See at CRAN