Skip to main content

Implementation of some pattern matching algorithms

Project description

PATTMATCH

https://github.com/monzita/pattmatch/blob/master/pmatch.png

More algorithms can be found here

Documentation

It’s here

Example

>>> from pattmatch import *
>>>
>>> kmp('ABCABC', 'ABC')
[[0, 3], [3, 6]]
>>> rabin_karb('ABCDAABC', 'ABC')
[[0, 3], [5, 8]]
>>> boyer_moore('AAABAAACAAD', 'AA')
[[0, 2], [1, 3], [4, 6], [5, 7], [8, 10]]
>>> z_array('ABCDAABBCAAAABBCAAAAABCA', 'AAAA')
[1, 0, 0, 0, 2, 1, 0, 0, 0, 4, 3, 2, 1, 0, 0, 0, 4, 4, 3, 2, 1, 0, 0, 1]

LICENCE

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pattmatch-0.0.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page