youdaoTranslate: Get result from youdao

Description Usage Arguments Details Value Author(s) References Examples

Description

This function return a result from youdao translation using url privided by youdaoUrl function.

Usage

1
youdaoTranslate(word, api, keyfrom)

Arguments

word

The word you want to look up.

api

A Youdao API key. You can get it from http://fanyi.youdao.com/openapi.

keyfrom

A Youdao keyfrom. You can get it from http://fanyi.youdao.com/openapi.

Details

All of three arguments are needed. This function will call youdaoUrl using getURL from RCurl package. The result is processed by fromJSON from rjson package.

Value

A list will be returned.

Author(s)

Ke-Hao Wu

References

http://fanyi.youdao.com/openapi?path=data-mode http://www.youdao.com/help/fanyiapi/privacy/

Examples

1
2
3
4
5
6
	library(RCurl)
	library(rjson)
	apikey = "498375134"
	keyfrom = "JustForTestYouDao"
	word = "youdao"
	Obj = youdaoTranslate(word,api=apikey,keyfrom=keyfrom)

RYoudaoTranslate documentation built on May 1, 2019, 8:41 p.m.