Levenshtein distance: how to better handle words swapping positions?

前端 未结 9 1483
忘掉有多难
忘掉有多难 2021-01-30 02:22

I\'ve had some success comparing strings using the PHP levenshtein function.

However, for two strings which contain substrings that have swapped positions, the algorithm

9条回答
  •  臣服心动
    2021-01-30 03:18

    Its easy. Just use the Damerau-Levenshtein distance on the words instead of letters.

提交回复
热议问题