forked from projectcalico/datrie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pytries#16 from xmonader/master
Suffixes method, test
- Loading branch information
Showing
6 changed files
with
6,805 additions
and
6,156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
================= | ||
|
||
|
@@ -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 | ||
|
Oops, something went wrong.