Beispiel #1
0
        public List<ActionModel> StartParse3(string json)
        {
            JToken parsed = JsonConvert.DeserializeObject<JToken>(json);
            List<ActionModel> list = new List<ActionModel>();

            foreach (var tweet in parsed)
            {
                var str = tweet["text"].ToString();
                string[] slovo = str.Split(' ');
                foreach (var s in slovo)
                {
                    if (s.Length > 3 && s[0] != '@' && s[0] != '#' && (s[0] != 'h' && s[2] != 't' && s[3] != 'p'))
                    {
                        ActionModel action = new ActionModel();
                        if (dict.ContainsKey(s.ToLower()))
                            action.Category = dict[s.ToLower()];
                        action.Text = s.ToLower();
                        list.Add(action);
                    }
                }
            }
            return list;
        }
Beispiel #2
0
        public List<ActionModel> StartParse4(string json)
        {
            JToken parsed = JsonConvert.DeserializeObject<JToken>(json);
            List<ActionModel> list = new List<ActionModel>();

            foreach (var tweet in parsed)
            {
                var str = tweet["text"].ToString();
                ActionModel action = new ActionModel();
                action.Text = str;
                action.Repeats = 1;
                action.Category = "11";
                list.Add(action);
            }
            return list;
        }
Beispiel #3
0
        public List<ActionModel>GetUsersByWord(string json)
        {
            JToken parsed = JsonConvert.DeserializeObject<JToken>(json);
            List<ActionModel> list = new List<ActionModel>();

            foreach (var tweet in parsed)
            {
                var str = tweet["user"]["screen_name"].ToString();

                        ActionModel action = new ActionModel();

                            action.Category = "Имена";
                        action.Text = "@"+str;
                        list.Add(action);

            }
            return list;
        }