开发者

Writing simple dictionary using java & google dictionary api

开发者 https://www.devze.com 2023-01-24 17:07 出处:网络
http://www.google.com/dictionary/json?callback=dict_api.callbacks.id100&q=test&sl=en&tl=en开发者_Python百科&restrict=pr%2Cde&client=te

http://www.google.com/dictionary/json?callback=dict_api.callbacks.id100&q=test&sl=en&tl=en开发者_Python百科&restrict=pr%2Cde&client=te (replace test with your favorite keyword)

using this i want to write simple dictionary....

problem - api give json output how i get it using java?


Simple Parsing Per default, JSON will just produce a nested graph of maps and lists. Here is an example of default parsing:

import org.svenson.JSONParser;

// assume json to be a JSON datasets as String

Object o = JSONParser.defaultJSONParser().parse(json);

o will now contain either a map or a list instance, depending on whether the first symbol in the JSON is '{' or '['.

0

精彩评论

暂无评论...
验证码 换一张
取 消