Exemplo n.º 1
0
        public void InsertWordsAndSearchForThemBySubstring5()
        {
            TrieBase trie   = new TrieBase();
            string   word   = "Bor";
            string   word01 = "YesPesho";

            trie.Insert(word01);
            string word1 = "IskamPomo";

            trie.Insert(word1);
            string word2 = "GoshoPesho";

            trie.Insert(word2);
            string word3 = "GoshoPeshoVanio";

            trie.Insert(word3);
            string word4 = "GoshoPeshoBore";

            trie.Insert(word4);

            ICollection <string> results = trie.Search(word, SearchType.Substring);
            bool actual = results.Contains(word4);

            Assert.AreEqual(true, actual);
        }
Exemplo n.º 2
0
        public ICollection <T> Search(string filter, int nrOfHits = int.MaxValue)
        {
            ICollection <string> strResults = TrieBase.Search(filter, nrOfHits);
            ICollection <T>      tResults   = GetValuesFromKeys(strResults, nrOfHits);

            return(tResults);
        }
Exemplo n.º 3
0
        public void InsertWordsAndSearchForThem()
        {
            TrieBase trie = new TrieBase();
            string   word = "Gosho";

            trie.Insert(word);
            string word2 = "GoshoPesho";

            trie.Insert(word2);
            ICollection <string> results = trie.Search(word);
            bool actual = results.Contains(word) && results.Contains(word2);

            Assert.AreEqual(true, actual);
        }