R/translate_full.R
translate_full.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. Compare to translate function, this function can get more useful translation information.
translate_full(x)
A vector made up of English or Chinese words
A list made up of Chinese or English words
# Example-1
translate_full("apple")
#> $phonetic
#> [1] "ˈæpl"
#>
#> $explains
#> [1] "n. 苹果"
#>
#> $web
#> [1] "苹果" "苹果公司" "苹果电脑" "苹果汁"
#>
# Example-2
x <- c("apple", "banana", "pear", "I love you")
translate_full(x)
#> $phonetic
#> [1] "ˈæpl"
#>
#> $explains
#> [1] "n. 苹果"
#>
#> $web
#> [1] "苹果" "苹果公司" "苹果电脑" "苹果汁"
#>
#> $phonetic
#> [1] "bəˈnænə"
#>
#> $explains
#> [1] "n. 香蕉;喜剧演员" "n. (Banana)巴纳纳(姓氏)"
#>
#> $web
#> [1] "喷鼻蕉" "芭蕉属植物" "香蕉皮"
#>
#> $phonetic
#> [1] "per"
#>
#> $explains
#> [1] "n. 梨,梨树" "【名】 (Pear)(英)皮尔(人名)"
#>
#> $web
#> [1] "梨" "梨子" "鸭梨" "梨树"
#>
#> $phonetic
#> [1] ""
#>
#> $explains
#> [1] "我爱你。"
#>
#> $web
#> [1] "我爱你" "爱老虎油" "王若琳" "爱很简单"
#>