Skip to content

Implementation of pattern matching in Python(using gestalt approach)

License

Notifications You must be signed in to change notification settings

abdulniyaspm/pyymatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 – @AbdulNiyas19[email protected]

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

About

Implementation of pattern matching in Python(using gestalt approach)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published