This documentation is for version 2.0.dev, which is not released yet.
Function returns dictionaries of the cells matched by the indices.
Parameters : | col : string (default=’‘)
row : string (default=’‘)
entry : string (default = ‘’)
|
---|---|
Returns : | entries : dict
|
See also
Notes
The ‘col’ and ‘row’ keywords in the function are all aliased according to the description in the wordlist.rc file. Thus, instead of using these attributes, the aliases can also be taken. For selecting a language, one may type something like:
>>> Wordlist.get_dict(language='LANGUAGE')
and for the selection of a concept, one may type something like:
>>> Wordlist.get_dict(concept='CONCEPT')
See the examples below for details.
Examples
Load the harry_potter.csv file:
>>> wl = Wordlist('harry_potter.csv')
Select all IPA-entries for the language “German”:
>>> wl.get_dict(language='German',entry='ipa')
{'Harry': ['haralt'], 'hand': ['hant'], 'leg': ['bain']}
Select all words (orthographical representation) for the concept “Harry”:
>>> wl.get_dict(concept="Harry",entry="words")
{'English': ['hæri'], 'German': ['haralt'], 'Russian': ['gari'], 'Ukrainian': ['gari']}
Note that the values of the dictionary that is returned are always lists, since it is possible that the original file contains synonyms (multiple words corresponding to the same concept).