Skip to content

Commit

Permalink
Merge pull request pytries#16 from xmonader/master
Browse files Browse the repository at this point in the history
Suffixes method, test
  • Loading branch information
kmike committed Feb 17, 2014
2 parents 1fc7b1c + 7b4a9b2 commit 85c195a
Show file tree
Hide file tree
Showing 6 changed files with 6,805 additions and 6,156 deletions.
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,21 @@ Get all items with a given prefix from a trie::
>>> trie.values(u'foob')
[10]

Get all suffixes of certain word starting with a given prefix from a trie::

>>> trie.suffixes()
[u'pro', u'producer', u'producers', u'product', u'production', u'productivity', u'prof']
>>> trie.suffixes(u'prod')
[u'ucer', u'ucers', u'uct', u'uction', u'uctivity']


Save & load a trie (values must be picklable)::

>>> trie.save('my.trie')
>>> trie2 = datrie.Trie.load('my.trie')



Trie and BaseTrie
=================

Expand Down Expand Up @@ -318,6 +327,7 @@ Authors & Contributors
* Mikhail Korobov <[email protected]>
* Jared Suttles
* Gabi Davar
* Ahmed T. Youssef

This module is based on `libdatrie`_ C library by Theppitak Karoonboonyanan
and is inspired by `fast_trie`_ Ruby bindings, `PyTrie`_ pure
Expand Down
Loading

0 comments on commit 85c195a

Please sign in to comment.