Sunday 18 June 2017

Making API calls and correcting spelling

So I have a website that takes in the city name from a search bar and it takes the input and makes an API call to my express backend which gets JSON information from a database that matches that city. So the call I make is:http://localhost:3001/api/wwtp/?q=los%20angelesand it gets me JSON information, but lets say the user mispells Los Angeles as Los Angleshttp://localhost:3001/api/wwtp/?q=los%20anglesreturns nothing.Is there a library out there that can check spelling or would I have to write something custom? I already have a list of all cities in the united states in JSON format and perhaps I can compare the user input with the list of cities. How would you approach this problem?

Submitted June 18, 2017 at 09:40PM by joeysk2012

No comments:

Post a Comment