Fuzzy search algorithm (approximate string matching algorithm)

后端 未结 6 1620
予麋鹿
予麋鹿 2020-12-22 17:36

I wish to create a fuzzy search algorithm. However, upon hours of research I am really struggling.

I want to create an algorithm that performs a fuzzy search on a l

6条回答
  •  星月不相逢
    2020-12-22 18:12

    You're confusing fuzzy search algorithms with implementation: a fuzzy search of a word may return 400 results of all the words that have Levenshtein distance of, say, 2. But, to the user you have to display only the top 5-10.

    Implementation-wise, you'll pre-process all the words in the dictionary and save the results into a DB. The popular words (and their fuzzy-likes) will be saved into cache-layer - so you won't have to hit the DB for every request.

    You may add an AI layer that will add the most common spelling mistakes and add them to the DB. And etc.

提交回复
热议问题