Ejemplo n.º 1
0
def test_trie():
    t = Trie(['he', 'hers', 'his', 'she'])
    results = t.match('a his hoge hershe xx.')
    assert len(results) == 5
    rows = [(2, 3), (11, 2), (11, 4), (14, 3), (15, 2)]
    for i in xrange(5):
        print results[i], rows[i]
        assert results[i] == rows[i]
Ejemplo n.º 2
0
def test_trie():
    t = Trie(['he','hers','his','she'])
    results = t.match('a his hoge hershe xx.')
    assert len(results) == 5
    rows = [(2,3), (11,2), (11,4), (14,3), (15,2)]
    for i in xrange(5):
        print results[i], rows[i]
        assert results[i] == rows[i]