Issue #1 resolved

PyTrie doesn't return the prefix if there are more longer prefixes that partially match

Armando Perez
created an issue



trie = StringTrie(seq=(('1', 'a',), ('138', 'b',), ('149', 'c',), )) print trie.longest_prefix_item('1324')

KeyError! It should return ('1', 'a'), since '1' is the longest key that is a prefix and has a value

print trie.longest_prefix_item('1384') ('138', 'b') }}}

Comments (2)

  1. Log in to comment