Ejemplo n.º 1
0
        public string ToJSON()
        {
            KeyValuePair <string, WitResponseArray> pair = this.GetEntityPair();
            var root = new WitResponseClass();

            root.Add(pair.Key, pair.Value);
            return(root.ToString());
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        public void Add(WitSimpleDynamicEntity entity)
        {
            KeyValuePair <string, WitResponseArray> pair = entity.GetEntityPair();

            entities.Add(pair.Key, pair.Value);
        }