admin管理员组文章数量:1390812
I'm trying to use Jim Breen's WWWJDIC server backdoor entry/api to query example sentences via indexed Japanese words, but my requests keep getting 500 internal server errors.
The API details can be found here: .html#backdoor_tag
Here is the code I'm using to make my GET request:
var lookupword = "辛い";
var kana = "からい";
// dictionary to use (1 = EDICT)
var n = 1;
// backdoor entry (Z = raw dictionary display)
var M = "Z";
// search type (E = example sentences via indexed Japanese words)
var t = "E";
// key type (U = UTF8, followed by "lookupword=n=kana=")
var k = $"U{System.Net.WebUtility.UrlEncode(lookupword)}=1={System.Net.WebUtility.UrlEncode(kana)}=";
var url = $"?{n}{M}{t}{k}";
using (var client = new HttpClient())
{
var request = await client.GetAsync(url);
var response = await request.Content.ReadAsStringAsync();
Console.WriteLine(response);
}
Here is the url
for the example above: =%E3%81%8B%E3%82%89%E3%81%84=
I'm trying to use Jim Breen's WWWJDIC server backdoor entry/api to query example sentences via indexed Japanese words, but my requests keep getting 500 internal server errors.
The API details can be found here: https://www.edrdg./wwwjdic/wwwjdicinf.html#backdoor_tag
Here is the code I'm using to make my GET request:
var lookupword = "辛い";
var kana = "からい";
// dictionary to use (1 = EDICT)
var n = 1;
// backdoor entry (Z = raw dictionary display)
var M = "Z";
// search type (E = example sentences via indexed Japanese words)
var t = "E";
// key type (U = UTF8, followed by "lookupword=n=kana=")
var k = $"U{System.Net.WebUtility.UrlEncode(lookupword)}=1={System.Net.WebUtility.UrlEncode(kana)}=";
var url = $"https://www.edrdg./cgi-bin/wwwjdic/wwwjdic?{n}{M}{t}{k}";
using (var client = new HttpClient())
{
var request = await client.GetAsync(url);
var response = await request.Content.ReadAsStringAsync();
Console.WriteLine(response);
}
Here is the url
for the example above: https://www.edrdg./cgi-bin/wwwjdic/wwwjdic?1ZEU%E8%BE%9B%E3%81%84=1=%E3%81%8B%E3%82%89%E3%81%84=
1 Answer
Reset to default 0I contacted Mr. Breen who said this may have been a bug.
They've updated the API and doco at https://www.edrdg./wwwjdic/wwwjdicinf.html#backdoor_tag, and the keytype lookupword=n=kana=
has been replaced with lookupword|n|kana|
.
I can now query example sentences using this URL format: https://www.edrdg./cgi-bin/wwwjdic/wwwjdic?1ZEUlookupword|n|kana|
For example: https://www.edrdg./cgi-bin/wwwjdic/wwwjdic?1ZEU%E8%BE%9B%E3%81%84|1|%E3%81%8B%E3%82%89%E3%81%84|
本文标签:
版权声明:本文标题:c# - How to query example sentence lookups via indexed Japanese words from Jim Breen's WWWJDIC server backdoor entryapi? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744665753a2618520.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论