multi pattern match library
Project description
mpml -- Multi Pattern Match Library
mpml is a Python module that can be used to speed up the execution of a large collection of words. Forever, it can be also used to speed up the execution of a large collection of regular expressions.
There is a similiar module named esmre in github. But esmre is not a regular engine. it cannot process a simple regexp. esmre has an excellent lib named libesm. I add some function for mpml:
save to file load from file fixed match result's field: start, end now are based unicode ,nor utf8
For regular expressions, i embed sregex (https://github.com/openresty/sregex).
Here is an example:
>>> from mpml import MultiPatternMatcher, MultiRegexpMatcher
>>> index = MultiPatternMatcher()
>>> index.add_word("abc", 1)
>>> index.add_word("bc", 2)
>>> index.end()
>>> index.saveFile("1.dat")
>>> index = MultiPatternMatcher()
>>> index.loadFile("1.dat")
>>> text = "this is abc"
>>> print(index.query(text))
>>> regexp = MultiRegexpMatcher()
>>> regexp.build(["a?c", "bc"])
>>> regexp.saveFile("2.dat")
>>> regexp.loadFile("2.dat")
>>> print(regexp.query(text))
>>>
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 Distributions
Built Distributions
File details
Details for the file mpml-1.0.1-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: mpml-1.0.1-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 195.0 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e482933f8ad506890e4bc5b8c3fa50184c5c2a2b30aeb045f30959f6bdb65203 |
|
MD5 | b3e00b458411e4ce06ee8d555c6e7ea7 |
|
BLAKE2b-256 | 19af0189bf04694643edfaa58960db3822d306cc3f7024d83143202863b0a341 |
File details
Details for the file mpml-1.0.1-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: mpml-1.0.1-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 233.1 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81b8b19601c111e648ecbdcaf094f7f28572c4c2a00a31fd36b3e16e7e4b2f6e |
|
MD5 | 98f1fc3954bd0e4867b704fc965abfb9 |
|
BLAKE2b-256 | 76508689b7e2e807bdfca15b7a95e2fafdc755e12b84745c5998a68d0f344db0 |
File details
Details for the file mpml-1.0.1-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: mpml-1.0.1-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 230.7 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4453cb29c1964b5ddbb0bb206a130395a43edb1c3d2b2c20643e4caf670b2942 |
|
MD5 | c7724cbfbce00c8de817d671d0df0e51 |
|
BLAKE2b-256 | 8aab6e9a8fdd765662ccfbe669a65f8d8d8310a4cdcc3e6ac915007bab06d471 |
File details
Details for the file mpml-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: mpml-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 136.5 kB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 131403894799e401bfc88246eb94bedb74ece29a0a999625fee2a346c8b9a642 |
|
MD5 | 2c37e94987676e59b01c6d4f59650ea1 |
|
BLAKE2b-256 | 53a8b559957a8d27b8c12627199591a0268d341e1f901ba3319b445bfa3a97bf |