nltk.util.Index in a standalone package.
Project description
# pip install justindex
# >>> from justindex import index
>>> index((len(s), s) for s in 'a b'.split())
defaultdict(<class 'list'>, {1: ['a', 'b']})
>>> index((len(s), s) for s in ''.split())
defaultdict(<class 'list'>, {})
>>> sorted(index((len(s), s) for s in 'a b cc'.split()).items())
[(1, ['a', 'b']), (2, ['cc'])]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
justindex-0.1.0.tar.gz
(903 Bytes
view hashes)