Esempio n. 1
0
        public void SanitizeText2()
        {
            Sanitizer     san            = new Sanitizer();
            List <string> sanitizedWords = san.SanitizeString("What do you mean by search in my account for deposit");

            Assert.AreEqual(3, sanitizedWords.Count);
        }
Esempio n. 2
0
        public QueryResponse Analyze(Query query)
        {
            ICollection <Questions> questions = new Collection <Questions>();

            var sanitizedWords = _textSanitizer.SanitizeString(query.Text);

            if (!query.InContext)
            {
                questions = _searchEngine.Search(sanitizedWords);
            }
            else
            {
                if (query.CurrentQuery.ChildQuestions != null && !query.CurrentQuery.ChildQuestions.Count().Equals(0))
                {
                    //query.CurrentQuery.ChildQuestions.Where(q=> q.

                    //foreach (var question in query.CurrentQuery.ChildQuestions.Where) {

                    //}
                }
            }

            return(new QueryResponse {
                PossibleQuestions = questions, Type = ResponseType.Question
            });
        }
Esempio n. 3
0
        public void SanitizeText()
        {
            Sanitizer     san            = new Sanitizer();
            List <string> sanitizedWords = san.SanitizeString("I want to know account balance");

            System.IO.Directory.Exists("");
            Assert.AreEqual(2, sanitizedWords.Count);
        }