-
Notifications
You must be signed in to change notification settings - Fork 6
[WIP] handle housenumbers that look like postcodes #31
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have code comments explaining why this behaviour is important (possibly with an example?), otherwise LGTM
looks like the new libpostal release will handle this case. will leave this open until we can verify that no additional handling is needed. |
new libpostal is good at this and doesn't make these mistakes anymore. |
libpostal still occasionally gets the number/postcode flipped. I'm going thru Orange County, CA right now and found the following examples where house number is parsed as postcode:
It might be a good idea to keep this logic around. |
These cases are slightly different in that there aren't both a housenumber and a postalcode, but rather only the housenumber. In this case we can't assume libpostal got it wrong because it may not have. We might actually need to send queries with both and return anything that matches. Most likely sending both will reveal the clear winner. |
In the US we might be able to work some magic since each state is allotted a range for postal codes: https://en.wikipedia.org/wiki/ZIP_Code#/media/File:ZIP_Code_zones.svg If libpostal returns a state, it wouldn't be hard to determine whether a zip code is likely a house number instead. |
add unit tests and acceptance tests and merge |
@dianashk please add code comments before merging. I feel like, looking back on this in 6 months it wouldn't be clear what the original purpose of this code block was. |
move this over to API now that text-analyzer is no longer being used. |
Looks like this is still an issue and the fix should be merged.
|
No description provided.