Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 2. There are exactly 50 states, so 50 names and 50 abbreviations.

Quick, spell the state that starts with "M" and ends in "ets"! How about "M"-"pi"? "T"-"see"?

I know, it's almost trivial to guess at misspellings. But that's just another piece of code you have to write.



Not if you know what to look for. I came across code that implements the metaphone algorithm (http://en.wikipedia.org/wiki/Metaphone) and used it for a sample project I started, but never finished, years ago (http://boston.conman.org/cgi-bin/location/location.cgi). It could be modified to allow free form text, instead of the text field for the city, pull-down for the state, but that's an implementation detail.

But the point is---code to check for misspellings already exists.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: