Reputation: 2825
I am trying to extract the parameters in fuzzysearch
https://github.com/taleinat/fuzzysearch
The result I get looks like this:
>>> from fuzzysearch import find_near_matches
# search for 'PATTERN' with a maximum Levenshtein Distance of 1
>>> find_near_matches('PATTERN', '---PATERN---', max_l_dist=1)
[Match(start=3, end=9, dist=1, matched="PATERN")]
How do I extract 'matched' and 'dist' from the resulting list? I can't seem to index the output
Upvotes: 1
Views: 313
Reputation: 15
To extract distance - near_matches[0].dist
. To extract pattern - near_matches[0].matched
Upvotes: 0