youyupei / fast_edit_distance

A quick implementation of edit distance with improved runtime.
MIT License
3 stars 1 forks source link

Error when using edit_distance on list and tuple. #1

Open HOZHENWAI opened 5 months ago

HOZHENWAI commented 5 months ago

One of the advantage of the Levenshtein library is that the distance function works on any iterable like list and tuple.

from Levenshtein import distance

distance([0,1,2,3,4,5], [5,4,1,2,3])

versus

from fast_edit_distance import edit_distance

edit_distance([0,1,2,3,4,5], [5,4,1,2,3])
HOZHENWAI commented 5 months ago

Obvious workaround would simply be to convert the iterable into string but we would have to check on the efficiency of the conversion.