slaypni / fastdtw

A Python implementation of FastDTW
MIT License
774 stars 122 forks source link

Handling collections of strings as an input #60

Open PR0123 opened 1 year ago

PR0123 commented 1 year ago

Can be used with edit distance algorithms. Example:

template = ["the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"]
query = ["the", "fox", "the", "dog"]
out = fastdtw(template, query, dist=Levenshtein.distance)
# output: (21, [(0, 0), (1, 1), (2, 1), (3, 1), (4, 2), (5, 2), (6, 2), (7, 3), (8, 3)])