Esempio n. 1
0
        public void SuffixTreeTest4()
        {
            SuffixTree tree = new SuffixTree('$', "PREFIX");

            SuffixTreeNodeTriplet[] expected = new SuffixTreeNodeTriplet[] {
                NonTerminal("EFIX$", "FIX$", "IX$", "PREFIX$", "REFIX$", "X$"),
                Terminal(2),
                Terminal(3),
                Terminal(4),
                Terminal(0),
                Terminal(1),
                Terminal(5),
            };
            CollectionAssertEx.AreEqual(expected, tree.BFS());
        }
Esempio n. 2
0
        public void SuffixTreeTest1()
        {
            SuffixTree tree = new SuffixTree('$', "tatat");

            SuffixTreeNodeTriplet[] expected = new SuffixTreeNodeTriplet[] {
                NonTerminal("at", "t"),
                NonTerminal("$", "at$"),
                NonTerminal("$", "at"),
                Terminal(3),
                Terminal(1),
                Terminal(4),
                NonTerminal("$", "at$"),
                Terminal(2),
                Terminal(0),
            };
            CollectionAssertEx.AreEqual(expected, tree.BFS());
        }