Implementation of pattern matching in Python(using gestalt approach). This library implements the underlaying algorithm(longest_common_substring) with C++.
pip install pyymatcher
>> 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']
- 0.0.1
- initial release
Python 3.6+
Abdul Niyas P M – @AbdulNiyas19 – [email protected]
Distributed under the MIT license. See LICENSE
for more information.
- Fork it (https://github.com/abdulniyaspm/pyymatcher/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request