find substring that Levenshtein Distance <= 1

We know string matching algorithm like KMP, horspool's and so on, but they can only match exactly.

How can I find the substrings that Levenshtein Distance <= 1?

For example, we match the pattern stirng "ware" in string "hereharewereworeherareteartoredeardareearrearehrerheasereseersearrah".
We can match [5-7]:are, [19-21]:are, [4-7]:hare, [18-21]:rare, [34-37]:dare and so on, also insertion can be matched like 'dware'.

please help me solve the problem^_^

Comments (0)