Ejemplo n.º 1
0
        public IList <SearchWord> ParseSearchPhrase(string searchPhrase, bool asYouType)
        {
            List <SearchWord> searchWords = new List <SearchWord>();

            List <string> words = Split(searchPhrase).ToList();

            for (int index = 0; index < words.Count; ++index)
            {
                string value     = words[index];
                bool   isPartial = asYouType && (index == words.Count - 1) && (searchPhrase == searchPhrase.TrimEnd());

                SearchWord searchWord = new SearchWord(value, isPartial);
                searchWords.Add(searchWord);
            }

            return(searchWords);
        }