Пример #1
0
    def test_build_trie(self):
        """Build_trie should build trie from seqs."""

        t = build_trie(iter(self.data.items()), Trie)
        self.assertTrue(isinstance(t, Trie))
        for (label, seq) in self.data.items():
            self.assertContains(t.find(seq), label)

        self.assertEqual(t.find(""), [])
        self.assertEqual(t.find("ccc"), [])
Пример #2
0
    def test_build_trie(self):
        """Build_trie should build trie from seqs."""
        
        t = build_trie(self.data.iteritems(), Trie)
        self.assertTrue(isinstance(t, Trie))
        for (label, seq) in self.data.iteritems():
            self.assertContains(t.find(seq), label)

        self.assertEqual(t.find(""), [])
        self.assertEqual(t.find("ccc"), [])
Пример #3
0
    def setUp(self):
        self.data = dict({
            "0": "ab",
            "1": "abababa",
            "2": "abab",
            "3": "baba",
            "4": "ababaa",
            "5": "a",
            "6": "abababa",
            "7": "bab",
            "8": "babba"
        })

        self.trie = build_trie(iter(self.data.items()))
Пример #4
0
    def setUp(self):
        self.data = dict({"0": "ab", "1":"abababa", "2":"abab",
                          "3":"baba", "4":"ababaa","5":"a", "6":"abababa",
                          "7":"bab", "8":"babba"})

        self.trie = build_trie(self.data.iteritems())