pylcs
pylcs copied to clipboard
Add alignment and fix a bug
-
Fix bug: The previous levenshtein_distance return 0 when either input is "". Like levenshtein_distance("aaa", "")=0 which should be 3 instead.
-
Add function:
-
lcs_sequence_idx
-
lcs_string_idx
-
levenshtein_distance_idx
-
edit_distance_idx mapping indices from str1 to reference
-
levenshtein_distance(str1, str2, weight) for weighted edit distance. All functions are updated with README and unittests.
- Format code and doc:
- Longest common subsequence as lcs_sequence_xxx
- Longest common substring as lcs_string_xxx _xxx including _length, _idx, _of_list. For compatibility, all previous function names are all preserved.