Ejemplo n.º 1
0
        public void Contains(string lookup, bool foundExpected)
        {
            string[] input         = { "abc", "abde" };
            var      stringTrieSet = new StringTrieSet();

            stringTrieSet.AddRange(input);

            Assert.Equal(foundExpected, stringTrieSet.Contains(lookup));
        }
Ejemplo n.º 2
0
        public StringTrieTest()
        {
            _words = GetWords();

            _stringTrie = new StringTrieSet();
            _stringTrie.AddRange(_words);

            _wordGroups = PreprocessWords();
        }
Ejemplo n.º 3
0
        public void GetByPrefix(string prefix, string[] found)
        {
            string[] input         = { "abc", "abde", "abx", "abxx" };
            var      stringTrieSet = new StringTrieSet();

            stringTrieSet.AddRange(input);

            var result = stringTrieSet.GetByPrefix(prefix).OrderBy(s => s);

            Assert.Equal(found.OrderBy(s => s), result);
        }