{"action":"closed","issue":{"url":"https://api.github.com/repos/thrustlabs/contact-parser/issues/15","labels_url":"https://api.github.com/repos/thrustlabs/contact-parser/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/thrustlabs/contact-parser/issues/15/comments","events_url":"https://api.github.com/repos/thrustlabs/contact-parser/issues/15/events","html_url":"https://github.com/thrustlabs/contact-parser/issues/15","id":101689305,"number":15,"title":"Parse city names even when there's no comma after the address line","user":{"login":"markstos","id":25829,"avatar_url":"https://avatars.githubusercontent.com/u/25829?v=3","gravatar_id":"","url":"https://api.github.com/users/markstos","html_url":"https://github.com/markstos","followers_url":"https://api.github.com/users/markstos/followers","following_url":"https://api.github.com/users/markstos/following{/other_user}","gists_url":"https://api.github.com/users/markstos/gists{/gist_id}","starred_url":"https://api.github.com/users/markstos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstos/subscriptions","organizations_url":"https://api.github.com/users/markstos/orgs","repos_url":"https://api.github.com/users/markstos/repos","events_url":"https://api.github.com/users/markstos/events{/privacy}","received_events_url":"https://api.github.com/users/markstos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-18T15:58:12Z","updated_at":"2015-08-20T13:34:18Z","closed_at":"2015-08-20T13:34:18Z","body":"I've got some real-world data I'd like to parse, which looks like this:\r\n\r\n```\r\n12892 East Center Avenue Aurora, CO  80012\r\n```\r\n\r\nThe very-useful comma between the address line and the city name is missing. \r\n\r\n[ESRI's geocoder can parse this](http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?f=pjson&text=12892%20East%20Center%20Avenue%20Aurora,%20CO%2080012) but `contact-parser` can't currently. \r\n\r\nHere's how I think it could be fixed:\r\n\r\n 1. After the current parsing pass, check if the city name is blank and the street type in the address line not recognized.\r\n 2. In that case, walk backwards in the address line looking for a recognized street type (like \"Street\", \"St',  \"Road\", etc). If one is found assume the characters after the street type are the city name, and move them to the empty city name field. \r\n\r\nThere are other open source libraries that we can borrow the list of US street types from.\r\n\r\nI'm open to contributing a PR for this, but wanted to discuss it first. \r\n\r\nAs an aside, has there been consideration to porting the code from CoffeeScript to ES6? ES6 offers a number of features of CoffeeScript, and there are also transpilers to convert it to ES5. I think it could increase contributions, since ES6 will be more common in the future than CoffeeScript. \r\n\r\nThe LogEntries client is an example of a module written in ES6: https://github.com/logentries/le_node"}}