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: discard parse containing single "suburb" label #1627

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

missinglink
Copy link
Member

It seems that libpostal gets confused with airports, returning the label suburb:

curl --get http://localhost:4400/parse \
  --data-urlencode 'address=john f kennedy international airport'

[{"label":"suburb","value":"john f kennedy international airport"}]

However it returns the correct label for a neighbourhood:

curl --get http://localhost:4400/parse \
  --data-urlencode 'address=soho'

[{"label":"suburb","value":"soho"}]

And also in the case where the text refers to either an airport or a neighbourhood:

curl --get http://localhost:4400/parse \
  --data-urlencode 'address=tegel'

[{"label":"suburb","value":"tegel"}]

I think the best course of action here is to check for any parse containing a single label of type "suburb" and then discarding it.
While this certainly will discard some valid neighbourhood parses, they should be adequately handled by the fallback parsing.

@missinglink
Copy link
Member Author

falling back to the pelias/parser in these cases seems preferable:

Screenshot 2022-06-21 at 17 00 29

Screenshot 2022-06-21 at 17 00 50

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.

1 participant