Skip to content

Unexpected behavior with only insertions allowed #29

@artemuk

Description

@artemuk

Hi! I'm using fuzzysearch v0.7.1 and I got a bit unexpected results when only insertions are allowed.
Here is the code:

matches = find_near_matches('12345', '123aa', max_deletions=0, max_substitutions=0, max_insertions=3)
print(matches)

Expected output:

[Match(start=0, end=3, dist=2, matched='123')]

I expected that substring '123' can be matched since we can insert '4' and '5' after it

Actual output

[]

But actually it doesn't return any matches.

Please tell me, am I missing something? Is this an intended behavior or a bug?
Thank you in advance!

OS: Ubuntu 19.04
Setup: Python 3.7 (miniconda), fuzzysearch 0.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions