pylcs icon indicating copy to clipboard operation
pylcs copied to clipboard

Add alignment and fix a bug

Open kuangkzh opened this issue 2 years ago • 0 comments

  1. Fix bug: The previous levenshtein_distance return 0 when either input is "". Like levenshtein_distance("aaa", "")=0 which should be 3 instead.

  2. 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.

  1. 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.

kuangkzh avatar Oct 29 '21 11:10 kuangkzh