pysettrie package
Project description
pysettrie
https://github.com/mmihaltz/pysettrie
pysettrie is a python3 package that provides support for efficient storage and querying of sets of sets using the trie data structure, supporting operations like finding all the supersets/subsets of a given set from a collection of sets. The original motivation for this module was to provide efficient search for supersets of sets of feature-value pairs in our natural language parser project (e.g. matching nouns against verb argument positions).
The following classes are included:
- SetTrie: set-trie container for sets; supports efficient supersets/subsets of a given search set calculations.
- SetTrieMap: mapping container using sets as keys; supports efficient operations like SetTrie but also stores values associated to the key sets.
- SetTrieMultiMap: like SetTrieMap, but supports multiple values associated to each key.
For further information, please see documentation
Module test_settrie.py contains unittests for all the containers.
Author: Márton Miháltz https://sites.google.com/site/mmihaltz/
This package depends on the sortedcollection module. One recommended way to install (tested on Ubuntu):
sudo pip3 install sortedcontainers
If you don't have pip3:
sudo apt-get install python3-setuptools
sudo easy_install3 pip
pysettrie is partly based on: I.Savnik: Index data structure for fast subset and superset queries. CD-ARES, IFIP LNCS, 2013. http://osebje.famnit.upr.si/~savnik/papers/cdares13.pdf Remarks on paper:
- Algorithm 1. does not mention to sort children (or do sorted insert) in insert operation (line 5)
- Algorithm 4. is wrong, will always return false, line 7 should be: "for (each child of node labeled l: word.currentElement <= l) & (while not found) do"
- the descriptions of getAllSubSets and getAllSuperSets operations are wrong, would not produce all sub/supersets
See also:
- http://stackoverflow.com/questions/9353100/quickly-checking-if-set-is-superset-of-stored-sets
- http://stackoverflow.com/questions/1263524/superset-search?rq=1
Changes:
- Version 0.1.3:
- SetTrieMultiMap.assign() returns number of values associated to key after assignment.
Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3.
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
Built Distribution
File details
Details for the file pysettrie-1.0.0.tar.gz
.
File metadata
- Download URL: pysettrie-1.0.0.tar.gz
- Upload date:
- Size: 140.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49988dc0917743d6e5e0fc44871d783ded8270def83de9bb742a1d446a09015c |
|
MD5 | 6bad5628ed4171fb5e8a80142c5d7770 |
|
BLAKE2b-256 | ab7f18e0bcdd6a7ecd04dcbe12252aad2c871825fbc145a5088084310e0dae81 |
File details
Details for the file pysettrie-1.0.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: pysettrie-1.0.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 218.8 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95ffcb3b753a739ee17c69ad2ba1067e5b671c8fb039a6dc12ea5b72c43bbcbd |
|
MD5 | a9d37c78c38726d1989a8c02cef701e7 |
|
BLAKE2b-256 | 58766413dcaf548187672d55666665ecc086ce91b0531448adebd4933dddb48d |