Learn R Programming

RYoudaoTranslate (version 1.0)

youdaoLookUp: The most important function in this package.

Description

You can use your word, API key and keyfrom in this function to get query result directly. That is to say, other functions are included in this function.

Usage

youdaoLookUp(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.

Examples

Run this code
	library(RCurl)
	library(rjson)
	apikey = "498375134"
	keyfrom = "JustForTestYouDao"
	word = c("youdao", "China", "Homo Sapiens")
	for( i in word)
	{
		Res = youdaoLookUp(i,api=apikey,keyfrom=keyfrom)
		print(Res)
	}

Run the code above in your browser using DataLab