Introduction to ecce


The goal of ecce is to make it easy to translate English words into Chinese, or translate Chinese words into English. It support pipe functions %>% to manipulate data.

# Install development version from GitLab

Basic usage

Translate a single words

# Example-1
x1 <- "苹果"

# Example-2
x2 <- "apple"

Translate a vector of words

# Example-3
x3 <- c("苹果", "香蕉", "梨子", "我爱你")

# Example-4
x4 <- c("apple", "banana", "pear", "I love you")

Get more useful translation information

# Example-5
x5 <- "苹果"

# Example-6
x6 <- "apple"

This function translate_full() also support pass into a vector which consists of Chinese or English words. But the form of output is not elegant enough.

Browse translate results in website

# Example-7
x7 <- "苹果"

# Example-8
x8 <- "apple"

In the same way, this function also support pass into a vector.

Manipulate data with pipe

love <- c("father", "mother", "I love U")
love %>%  
  translate() %>% 
  paste0(., collapse = "")

Code sources and improvements

ecce package is based on RYoudaoTranslate(Ke-Hao Wu, 2014), which provides function to translate English words into Chinese. also provides interface to Youdao translation open API for R user. But this software is not very friendly to use, which can't support translate Chinese words into English, I have made some improvements on the basis of this software.


Ke-Hao Wu (2014). RYoudaoTranslate: R package provide functions to translate English words into Chinese. R package version 1.0.

Try the ecce package in your browser

Any scripts or data that you put into this service are public.

ecce documentation built on Jan. 18, 2022, 1:10 a.m.