thrustlabs/contact-parser — pull request #12 by markstos (2014-08-19 13:34:00+00:00)
Title: Fix crash with 'string' being undefined.

This fix implements how it appears the code was intended to work, but not that
while the parsing doesn't fail in this case, it does wrongly guess the city
name.

I would rather have no answer than a wrong answer, so I would be OK with no
city name being returned.

If you want to more aggressively try to find a city name, could try some other strategies:

* Make sure prospective city name doesn't match the "Apt #" regex, like "#5" here.
* Make sure the city name doesn't look like a street designator, like "Street"

Even then, you still fail on all two word city names, so I think it would be
nice to at least have an /option/ here to just give up on trying to find the
city name, if not give up completely in this case.