hassansin / parse-address

US Street Address Parser
http://hassansin.github.io/parse-address/
Other
157 stars 81 forks source link

Add support for intersection without city #29

Closed nikmolnar closed 4 years ago

nikmolnar commented 4 years ago

Intersection locations without a city currently fail to parse (e.g., Mission St and Valencia St). Based on the regex pattern for intersection, this seems to be a bug, since place is optional, but a space before place is required (indeed, Mission St and Valencia St parses as expected).

This changes the pattern to look for one or more spaces or the end of the string: ($|\W+).

Tests have been updated with examples of cityless intersections.