Package nltk :: Module containers :: Class SortedDict
[hide private]
[frames] | no frames]

Class SortedDict

source code

object --+    
         |    
      dict --+
             |
            SortedDict

A very rudamentary sorted dictionary, whose main purpose is to allow dictionaries to be displayed in a consistent order in regression tests. keys(), items(), values(), iter*(), and __repr__ all sort their return values before returning them. (note that the sort order for values() does *not* correspond to the sort order for keys(). I.e., zip(d.keys(), d.values()) is not necessarily equal to d.items().

Instance Methods [hide private]
list of D's keys
keys(self) source code
list of D's (key, value) pairs, as 2-tuples
items(self) source code
list of D's values
values(self) source code
an iterator over the keys of D
iterkeys(self) source code
an iterator over the (key, value) items of D
iteritems(self) source code
an iterator over the values of D
itervalues(self) source code
 
__iter__(self)
iter(x)
source code
 
repr(self) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __init__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, pop, popitem, setdefault, update

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

keys(self)

source code 
Returns: list of D's keys
Overrides: dict.keys
(inherited documentation)

items(self)

source code 
Returns: list of D's (key, value) pairs, as 2-tuples
Overrides: dict.items
(inherited documentation)

values(self)

source code 
Returns: list of D's values
Overrides: dict.values
(inherited documentation)

iterkeys(self)

source code 
Returns: an iterator over the keys of D
Overrides: dict.iterkeys
(inherited documentation)

iteritems(self)

source code 
Returns: an iterator over the (key, value) items of D
Overrides: dict.iteritems
(inherited documentation)

itervalues(self)

source code 
Returns: an iterator over the values of D
Overrides: dict.itervalues
(inherited documentation)

__iter__(self)

source code 

iter(x)

Overrides: dict.__iter__
(inherited documentation)