Misspelled word detection

I have a list of airport names, and my users have the option to enter one airport name to select it for further processing.

How would you handle misspelled names and submit a list of sentences?

+7
language-agnostic algorithm spell-checking search-suggestion
source share
8 answers

Look at the Levenshtein distances to match the correct name for this user input.

+7
source share

http://norvig.com/spell-correct.html
does something like levenshtein, but because it doesn't go all the way, its more efficient

+4
source share

Use spell checking in your code. The list of words should contain only the correct spelling of the airports.

This is not the best way to do this. You should either go for a control that provides automatic completion, or a drop-down list, as others suggested.

Use AJAX if your technology supports it.

+1
source share

I know that this is not what you requested, but if this is an application in which the correct location of the airport is important (for example, ordering tickets), you may want to receive confirmation to make sure that you have the right one. For example, people got tickets for the wrong Sydney , for example.

+1
source share

It might be better to select a user from the list of airport names instead of letting them enter them on their own. No errors can be made this way.

0
source share

Until that helps right away, you can track typos and see what name they finally enter when entering the correct name. This way you can keep track of the most common typos and suggest the best options.

0
source share

Adding to Kevin’s suggestion, it can be the best of both worlds if you use javascript autocomplete input field. e.g. jquery autocomplete

edit: Danish beat me up: (

0
source share

There may be an existing spell checker library that you can use. The code for this kind of thing is not trivial. If you want to write it yourself, you can look at the trie dictionary .

One of the ways that can work is to simply create a huge list of possible error words and their corrections ( Python implementation is implemented here) that you can cache for better performance.

0
source share

All Articles