I'm trying to parse the response from wit in C# and I cannot.
I do it for google speech and, it took me a while, but it works. This is what I have:
support class definitions:
public class wit
{
string msg_id {get; set;}
string msg_body {get; set;}
List<witoutcome> outcome;
public wit()
{
outcome = new List<witoutcome>();
}
}
public class witoutcome
{
string intent { get; set; }
List<string> entitites { get; set; }
string confidence { get; set; }
public witoutcome()
{
entitites = new List<string>();
}
}
parsing :
wit r = Newtonsoft.Json.JsonConvert.DeserializeObject<wit>(HtmlResult);
The result is empty after the parsing (but no errors).
The difference I see between the text coming from wit, against the on coming from google is only the presence of new lines.
Here I copy the two responses for comparison:
Coming from google:
{"status":0,"id":"","hypotheses":[{"utterance":"Hola","confidence":0.63361013},{"utterance":"hola"},{"utterance":"ola"},{"utterance":"hola A"},{"utterance":"Hola y"}]}
Coming from wit:
{
"msg_id" : "7bc38e0a-a1ae-4931-bbe6-910f3a0df9e0",
"msg_body" : "what time is it?",
"outcome" : {
"intent" : "search_in_google",
"entities" : { },
"confidence" : 0.503
}
}
Any idea on how to deal with that ??