This package (MIDR) calculates global edit distance and local edit distances. how to use:
- Import Midr class from midr package:
from midr import Midr
- create object giving 4 parameters (M - match score, I - insert score, D - delete score,
R - replace score, default: 0, 1, 1, 1 - Livenstein distance):
obj = Midr(1, -1, -1, -1)
- Calculate distance between 2 strings:
obj.global_edit_distance(word1, word2)
orobj.local_edit_distance(word1, word2)