Skip to main content

Implementation of pattern matching in Python(using gestalt approach)

Project description

PyyMatcher

License Version Python versions Code style: black

Implementation of pattern matching in Python(using gestalt approach). This library implements the underlaying algorithm(longest_common_substring) with C++.

Installation

pip install pyymatcher

Usage example

>> from pyymatcher import PyyMatcher, get_close_matches

>>> obj = PyyMatcher('Word1', 'word1')
>>> obj.ratio()
0.8
>>> obj.ratio(case_insensitive=True)
1.0
>>> obj.longest_common_substr
'ord1'

>>> word = 'thiis'
>>> get_close_matches(word=word, 
                      possibilities=['tthis', 'thhis', 'this', 'thiss', 'THIS'], 
                      n=1)
['this']
>>> get_close_matches(word=word, 
                      possibilities=['tthis', 'thhis', 'this', 'thiss', 'THIS'], 
                      n=2, 
                      case_insensitive=True)
['this', 'THIS']

Release History

  • 0.0.1
    • initial release

Support

Python 3.6+

Meta

Abdul Niyas P M – @AbdulNiyas19abdulniyaspm@gmail.com

Distributed under the MIT license. See LICENSE for more information.

Github Profile

Contributing

  1. Fork it (https://github.com/abdulniyaspm/pyymatcher/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

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

pyymatcher-0.0.5.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file pyymatcher-0.0.5.tar.gz.

File metadata

  • Download URL: pyymatcher-0.0.5.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.2

File hashes

Hashes for pyymatcher-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a7216e9991f25ef7cc682ee6e352de78c010426a169f4240688714efd3dcee63
MD5 bdfad0da8afe143b404b5d65f61c4f3b
BLAKE2b-256 03108f7b2ff9b721096d4fe82e2d3cdb3ef136df1384f51edd79cd03f74d21f3

See more details on using hashes here.

Supported by

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