Ideas for creating a “Did you mean XYZ” feature into website

后端 未结 4 901
时光说笑
时光说笑 2020-12-13 05:25

I\'d like to give users the ability to search through a large list of businesses, but still find near matches.

Does anyone have any recommendations on how best to go

4条回答
  •  悲哀的现实
    2020-12-13 06:20

    Check out the wikipedia article on Levenshtein distance. It's a fairly simple concept to wrap your head around and pretty easy to implement an algorithm in whichever language you are using, in your case, C#.

    I found an example in C# for you here.

    Also, here is an example of a spelling corrector from Peter Norvig of Google. It was said on the SO podcast a few episodes ago that Jon Skeet attempted a rewrite of this same algorithm in C#. Not sure if he completed it and/or made it publicly available though.

提交回复
热议问题