public string ToJSON() { KeyValuePair <string, WitResponseArray> pair = this.GetEntityPair(); var root = new WitResponseClass(); root.Add(pair.Key, pair.Value); return(root.ToString()); }
public KeyValuePair <string, WitResponseArray> GetEntityPair() { var keywordEntries = new WitResponseArray(); foreach (string keyword in keywords) { var synonyms = new WitResponseArray(); synonyms.Add(new WitResponseData(keyword)); var keywordEntry = new WitResponseClass(); keywordEntry.Add("keyword", new WitResponseData(keyword)); keywordEntry.Add("synonyms", synonyms); keywordEntries.Add(keywordEntry); } return(new KeyValuePair <string, WitResponseArray>(entity, keywordEntries)); }
public void Add(WitSimpleDynamicEntity entity) { KeyValuePair <string, WitResponseArray> pair = entity.GetEntityPair(); entities.Add(pair.Key, pair.Value); }