Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support parsing postcode from fullText address with libpostal #54

Open
cordovapolymer opened this issue May 10, 2017 · 2 comments
Open

Comments

@cordovapolymer
Copy link

Hi,
As the OpenStreetMap address data is not normalized db wide, I'm using libpostal parse_address to assign common labels.
Could you modify the
ADDR_LONG_TEXT
to start with ISO country code or move the postcode to the end of the string, so libpostal would understand the postcode?

Here's an example how libpostal handles address data without and with the country code, and with the postcode in the end of the address

>>> from postal.parser import parse_address
>>> parse_address('SG19 3EP, 19-21, Church End, Gamlingay CP (S Cambs), South Cambridgeshire, Cambridgeshire')
[(u'sg19 3ep', u'suburb'), (u'19-21', u'house_number'), (u'church end', u'road'), (u'gamlingay cp s cambs', u'city'), (u'south cambridgeshire cambridgeshire', u'state_district')]

>>> parse_address('UK SG19 3EP, 19-21, Church End, Gamlingay CP (S Cambs), South Cambridgeshire, Cambridgeshire')
[(u'uk', u'country'), (u'sg19 3ep', u'postcode'), (u'19-21', u'house_number'), (u'church end', u'road'), (u'gamlingay cp s cambs', u'city'), (u'south cambridgeshire cambridgeshire', u'state_district')]

>>> parse_address('19-21, Church End, Gamlingay CP (S Cambs), South Cambridgeshire, Cambridgeshire, SG19 3EP')
[(u'19-21', u'house_number'), (u'church end', u'road'), (u'gamlingay cp s cambs', u'city'), (u'south cambridgeshire cambridgeshire', u'state_district'), (u'sg19 3ep', u'postcode')]
@cordovapolymer
Copy link
Author

@kiselev-dv , I tried modifying the

public Collection<String> getSupportedKeys() {
my self, but it didn't change the position of the postcode.
Can you advise me what to change to move the postcode to the end of the address?

@kiselev-dv
Copy link
Owner

kiselev-dv commented May 10, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants