Пример #1
0
        public Place(List<string> words)
        {
            Words = words;
            Answer = BaseMethod.CheckContext(Words, "place_name", "dbo.place", Parametrs);


        }
Пример #2
0
        public Message(string stringOfMessage)
        {
            var clearString = Regex.Replace(stringOfMessage, "[-.?!)(,:]", " ");

            Words = (clearString.Split(' ')).ToList();
            Words.RemoveAll(x => (x.Trim().Length == 0));
            KeyWords = BaseMethod.CheckContext(Words, "word", "dbo.key_words", Parametrs);
            if (KeyWords == "")
            {
                Answer = "Вы ввели неправильный запрос, я  всеголишь бот.";
            }
            else
            {
                switch (KeyWords)
                {
                case "Place":
                    var answerPlace = new Place(Words);
                    Answer           = answerPlace.Answer;
                    ParametersReturn = Answer.Split(',');
                    break;
                }
            }
        }