pelias / pelias/parser

Handle different street/number orderings

Open
#189 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
64
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I've noticed that the parser has issues in some cases with addresses that it should be able to parse. Unfortunately I have a really hard time grokking this codebase, so forgive any unscientific descriptions of what I observe. But I think one of the issues is a sort of bias to <number> <street> ordering.

Steps to Reproduce

Try to parse Lehtmäe tn 18. For a quick repro, the compare tool works for this via autocomplete.

{
  "subject": "Lehtmäe tn 18",
  "street": "Lehtmäe tn 18"
}

If you flip the order around to put the house number first, this actually will parse successfully. It even knows about the Estonian street abbreviation. (Elsewhere, this is also not ordered correctly btw, but this report focuses on the parser.)

Expected behavior

Probably this:

{
  "subject": "Lehtmäe tn 18",
  "housenumber": "18",
  "street": "Lehtmäe tn"
}

Environment (please complete the following information):

Probably N/A; reproducible on my Mac locally, on Linux servers using the official images, etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the parser behavior exercised by the compare tool's autocomplete request for Lehtmäe tn 18, then compare it with the working house-number-first ordering. Reproduce the issue and make the parser return housenumber: "18" and street: "Lehtmäe tn" while preserving the subject.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.