How to correct the user input (Kind of google “did you mean?”)

后端 未结 8 1194
粉色の甜心
粉色の甜心 2021-01-30 23:50

I have the following requirement: -

I have many (say 1 million) values (names). The user will type a search string.

I don\'t expect the user to spell the names c

8条回答
  •  时光取名叫无心
    2021-01-31 00:33

    I would consider using a pre-existing solution for this.

    Aspell with a custom dictionary of the names might be well suited for this. Generating the dictionary file will pre-compute all the information required to quickly give suggestions.

提交回复
热议问题