【发布时间】:2021-07-23 08:45:20
【问题描述】:
我尝试执行此操作:
wget --post-data 'The quick brown fox jumped over the lazy dog.' 'localhost:9000/?properties={"annotators":"tokenize,ssplit,pos","outputFormat":"json"}' -O -
将here 转换为C# RestSharp 代码。 AFIK 这是一个帖子请求?所以我选择了这段代码:
var client = new RestClient(@"http://localhost:9000/?properties={""annotators"":""tokenize,ssplit,pos"", ""outputFormat"":""json""}")
{
Timeout = 5000
};
var request = new RestRequest(Method.POST);
request.AddBody(@"The quick brown fox jumped over the lazy dog.");
var response = client.Execute(request);
这会返回:
{
"sentences": [
{
"index": 0,
"tokens": [
{
"index": 1,
"word": "<String />",
"originalText": "<String />",
"characterOffsetBegin": 0,
"characterOffsetEnd": 10,
"pos": "ADD",
"before": "",
"after": ""
}
]
}
]
}
这有点空。所以我认为我的翻译有些不正确。有什么想法吗?
【问题讨论】:
-
您期望得到什么?你从 wget 命令得到什么?
标签: c# stanford-nlp restsharp