1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
.. PyTrie documentation master file, created by sphinx-quickstart on Sun Dec 20 20:05:26 2009.
Welcome to PyTrie's documentation!
==================================
.. automodule:: pytrie
Reference documentation
-----------------------
Classes
~~~~~~~
.. autoclass:: Trie
:show-inheritance:
:members: __init__, fromkeys, KeyFactory, NodeFactory
.. autoclass:: StringTrie
:show-inheritance:
.. autoclass:: SortedTrie
:show-inheritance:
.. autoclass:: SortedStringTrie
:show-inheritance:
Trie methods
~~~~~~~~~~~~
The following methods are specific to tries; they are not part of the mapping API.
.. automethod:: Trie.longest_prefix(key[, default])
.. automethod:: Trie.longest_prefix_value(key[, default])
.. automethod:: Trie.longest_prefix_item(key[, default])
.. automethod:: Trie.iter_prefixes
.. automethod:: Trie.iter_prefix_values
.. automethod:: Trie.iter_prefix_items
Extended mapping API methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following methods extend the respective mapping API methods with an optional
``prefix`` parameter. If not ``None``, only keys (or associated values/items)
that start with ``prefix`` are returned.
.. automethod:: Trie.keys
.. automethod:: Trie.values
.. automethod:: Trie.items
.. automethod:: Trie.iterkeys
.. automethod:: Trie.itervalues
.. automethod:: Trie.iteritems
Original mapping API methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following methods have the standard mapping signature and semantics.
.. automethod:: Trie.__len__
.. automethod:: Trie.__iter__
.. automethod:: Trie.__contains__
.. automethod:: Trie.__getitem__
.. automethod:: Trie.__setitem__
.. automethod:: Trie.__delitem__
.. automethod:: Trie.__repr__
.. automethod:: Trie.clear
.. automethod:: Trie.copy
.. automethod:: Trie.has_key
Internals
~~~~~~~~~
Tries are implemented as trees of :class:`Node` instances. You don't need to
worry about them unless unless you want to extend or replace :class:`Node` with
a new node factory and bind it to :attr:`Trie.NodeFactory`.
.. autoclass:: Node()
:show-inheritance:
:members:
|