Example #1
0
    def test_NRPattern(self):
        """


        """
        trie = DoubleArrayTrie()
        NRPattern.sort()
        trie.build(key=NRPattern)
        self.assertTrue(trie.exact_match_search("BCD") != -1)
        self.assertTrue(trie.exact_match_search("BBCD") != -1)
        self.assertTrue(trie.exact_match_search("BG") != -1)
        self.assertTrue(trie.exact_match_search("DG") != -1)
        self.assertTrue(trie.exact_match_search("CD") == -1)
Example #2
0
 def __init__(self):
     self.trie = DoubleArrayTrie()
     NRPattern.sort()
     self.trie.build(key=NRPattern)