示例#1
0
        public void NearSearch()
        {
            // Arrange
            var tree = new TernaryTree(Language.Swedish);
            tree.Add("abcde", "abce", "abcf");

            // Act
            var matches = tree.NearSearch("abc");

            // Assert
            Assert.AreEqual(2, matches.Count);
        }
示例#2
0
        public void TestTreeNearSearchForValues()
        {
            TernaryTree <string> tree = new TernaryTree <string>();
            var InputKeys             = "aback abacus abalone abandon abase abash abate abbas abbe abbey abbot Abbott".ToLower().Split(' ');

            foreach (var key in InputKeys)
            {
                tree.Add(key, "value of " + key);
            }
            var near  = tree.NearSearch("abacus", 5);
            int count = getCount(near);

            Assert.AreEqual(10, count);
        }
示例#3
0
 public void TestTreeNearSearchForValues()
 {
     TernaryTree<string> tree = new TernaryTree<string>();
     var InputKeys = "aback abacus abalone abandon abase abash abate abbas abbe abbey abbot Abbott".ToLower().Split(' ');
     foreach (var key in InputKeys)
     {
         tree.Add(key, "value of " + key);
     }
     var near = tree.NearSearch("abacus", 5);
     int count = getCount(near);
     Assert.AreEqual(10, count);
 }