hassansin / parse-address

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

Using # as secondary designator results in inconsistent behavior #32

Open bluenike opened 4 years ago

bluenike commented 4 years ago

We have an html input for address entry. We use Google Maps Autocomplete to provide suggestions. Google Maps doesn't handle secondary designators very well during interactive input, so we use parse-address to remove the secondary designator. For this reason, it's important that parse-address acts consistently with partial input (as the user is typing).

Input: "10 miller pl Unit 505, san fran" Output: {"number":"10","street":"miller","type":"Pl","sec_unit_type":"Unit","sec_unit_num":"505"} Comment: Correctly identifies secondary information as "Unit 505"

However--

Input: "10 miller pl #505, san fran" Output: {"number":"10","street":"miller","type":"Pl"} Comment: Does not correctly identify secondary information as "#505" until the entire address is completely entered.

Input: "10 miller pl #505, san francisco, ca" Output: {"number":"10","street":"miller","type":"Pl","sec_unit_type":"Unit","sec_unit_num":"505"} Comment: Correctly identifies all components.