pytst: C++ TernarySearchTree with Python bindings

Basically, it behaves like a dictionary, but ... TSTs are a lot smarter than dictionaries when it comes to:

  • Prefix-matching (find the longest entry in the TST which is a prefix to a given string)

  • Scanning (using the Aho-Corasick algorithm, you can implement pretty efficient scanners with a TST, scaling up to tens of thousands of entries)

  • Spelling correctors (find a set of entries which spelling is close to a given string. The distance used is the Levenshtein distance).

http://nicolas.lehuen.com/download/pytst/