Skip to content

Comments

stricter_postcodes#42

Merged
missinglink merged 2 commits intomasterfrom
stricter_postcodes
Jun 6, 2019
Merged

stricter_postcodes#42
missinglink merged 2 commits intomasterfrom
stricter_postcodes

Conversation

@missinglink
Copy link
Member

enforce stricter postcode parsing:

  • reduce the number of country codes we load (feel free to add more)
  • do not allow postcode in the first position unless its the only token.

this greatly improves autocomplete parsing of addresses with high housenumbers (>1000)

@orangejulius
Copy link
Member

do not allow postcode in the first position unless its the only token.

This might be too strict. We often get queries like "6000, NSW, Australia" which are queries for postalcodes

@missinglink missinglink force-pushed the stricter_postcodes branch from 67fb254 to c1d6c94 Compare June 6, 2019 13:05
@missinglink
Copy link
Member Author

Yea it's unfortunate but we have way more queries such as this which need to be fixed:

      "text": "2211 SW",
      "parser": "pelias",
      "parsed_text": {
        "subject": "2211",
        "postcode": "2211"
      },

I suspect that the query you posted above will still work as expected without the postcode parse because the number will still be considered the 'subject' of the query.

@orangejulius
Copy link
Member

Oh yeah, that should work well. 👍

@missinglink
Copy link
Member Author

@orangejulius a little more leniency added :)
5ca3720

@missinglink
Copy link
Member Author

Keeping track of section boundaries is super useful for things like this, it's a pity that libpostal simply discards them..

@missinglink missinglink merged commit e77bebb into master Jun 6, 2019
@missinglink missinglink deleted the stricter_postcodes branch June 6, 2019 13:24
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.

2 participants