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

libpostal aus unit numbers #1216

Merged
merged 4 commits into from
Oct 23, 2018
Merged

libpostal aus unit numbers #1216

merged 4 commits into from
Oct 23, 2018

Conversation

missinglink
Copy link
Member

@missinglink missinglink commented Oct 23, 2018

This PR fixes a bug in libpostal when parsing AUS unit numbers, as per pelias/pelias#753

The PR assumes that the order of forward-slash delimited address numerals is in the order {unit}/{house number}. I did some checking online and consulted https://en.wikipedia.org/wiki/Address_(geography) and it seems to be a fairly safe bet.

You can do a ctrl+f on that wiki page and search for slash, the only other countries listed as possibly having a slash are Czech Republic and Slovakia.

In both of those cases, the slash represents an addressing scheme which we don't currently support, so I think that the change will be hugely positive for Australia while having no real negative impact elsewhere.

The PR is in 4 parts:

  • refactor to use an index: as more 'bugfixes' are added, we need to avoid iterating the array multiple times, so this introduces an index and also refactors an existing bugfix to take advantage of it.
  • parse the Aussie unit numbers
  • enable field mapping for 'unit', for some reason we were not mapping 'unit' from libpostal to our schema, I can't see any reason why, so I've enabled it since we are working towards better unit number support.
  • additional test cases to cover variants provided by OP

resolves: pelias/pelias#753

Copy link
Member

@orangejulius orangejulius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

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

Successfully merging this pull request may close these issues.

Falling back to suburb when the unit number isn't matched
2 participants