Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AI and Deep Learning by (50.2k points)

I want to write a "Did you mean" algorithm.

I have a set of words (Just like git commands such as pull, push, clone).

I need to give suggestions whenever users are entering a word out of the set of words.

All the above details are the background of my question :)

"Do you mean" in git

I want to copy ;) the code used in the git to implement 'Did you mean' algorithm to accomplish my task.

Do you know the location of the git-source-file containing the 'Did you mean' algorithm?

1 Answer

0 votes
by (108k points)

To put it simply, for an edit distance algorithm, the aim is to calculate given a set of basic edit operations on the data type you're working on (strings in your case) the minimum number of edits to make one value (string) identical to the other one. The relevant code is in Levenshtein.c (edit distance computation) and help.c (cutoff). The Levenshtein distance is also referred to as the Edit Distance. It calculates the least number of edits an algorithm would require to do to correct a word, taking into consideration the distance between keys.

To know how does google’s ‘did you mean’ algorithm work, refer to the following link:

If you are looking to learn more about Artificial Intelligence then you visit Artificial Intelligence(AI) Tutorial. Also, if you are appearing for job profiles of AI Engineer or AI Expert then you can prepare for the interviews on Artificial Intelligence Interview Questions.

Browse Categories