A Dictionary contains all the Words in a given part of speech. Four
dictionaries, bound to N, V, ADJ, and ADV, are bound by default in
__init.py__.
Indexing a dictionary by a string retrieves the word named by that
string, e.g. dict['dog']. Indexing by an integer n retrieves the nth
word, e.g. dict[0]. Access by an arbitrary integer is very slow except
in the special case where the words are accessed sequentially; this is to
support the use of dictionaries as the range of a for statement and as
the sequence argument to map and filter.
|
__init__(self,
pos,
filenameroot)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
|
|
|
|
word(self,
form,
line=None)
Returns:
The Word object with the supplied form, if present. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get(self,
key,
default=None)
Return the Word whose form is key, or default. |
source code
|
|
|
keys(self)
Returns:
A sorted list of strings that index words in this dictionary. |
source code
|
|
|
has_key(self,
form)
Checks if the supplied argument is an index into this dictionary. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__str__
|