Finding if two strings are almost similar

后端 未结 6 1387
小鲜肉
小鲜肉 2020-12-29 10:00

I want to find out if you strings are almost similar. For example, string like \'Mohan Mehta\' should match \'Mohan Mehte\' and vice versa. Another example, string like \'Um

6条回答
  •  梦毁少年i
    2020-12-29 10:15

    you might want to look at NLTK (The Natural Language Toolkit), specifically the nltk.metrics package, which implements various string distance algorithms, including the Levenshtein distance mentioned already.

提交回复
热议问题