R/translate.R
translate.Rd
When you pass in a vector consisting of an English or Chinese words, this function will calls the Youdao translation open API for R to return the corresponding type of Chinese or English representation.
translate(x)
A vector made up of English or Chinese words
A vector made up of Chinese or English words
# Example-1
translate("apple")
#> [1] "苹果"
# Example-2
x <- c("apple", "banana", "pear", "I love you")
translate(x)
#> [1] "苹果" "喷鼻蕉" "梨" "我爱你"