[{
"_text" = "turn off the air con";
confidence = "0.609";
entities = {
"on_off" = (
{
value = off;
}
);
};
intent = "aircond_temperature";
}]
I have a json response named "outcomes", and I would like to extract the "off" value from "on_off".
So far what I've done is to get the first element from the response and then cast it to an NSDictionary which works fine, and then using object for key to get the values of each dictionary, and casting them to their respective types.
let firstOutcome:NSDictionary = outcomes.first as! NSDictionary
let intent:String = firstOutcome.objectForKey("intent") as! String
let entities:NSDictionary = firstOutcome.objectForKey("entities") as! NSDictionary
But when it comes to entities I have no idea what type should I cast "on_off" to. Any ideas?