I notice if I make a typo in Google search bar, it is very likely to correct it for me.
Like, if I type "incerdible", it will suggest "incredible", or for "stackovflow", it will be "stackoverflow".
What is the core idea of such algorithm?
I notice if I make a typo in Google search bar, it is very likely to correct it for me.
Like, if I type "incerdible", it will suggest "incredible", or for "stackovflow", it will be "stackoverflow".
What is the core idea of such algorithm?
Here is an explanation, and some more links with further details:
There are many algorithms to solve that problem. The core algorithm is to calculate the difference between two words. You can take a look at Levenshtein distance, this is a great algorithm to do that.
If you want to use something like that, you can use some npm package like this:
© 2022 - 2024 — McMap. All rights reserved.