Skip to content

feat(matching): allow for street abbreviations when comparing addresses - #982

Merged
brawer merged 1 commit into
mainfrom
street-abbreviations-981
Nov 17, 2026
Merged

brawer merged 1 commit into
mainfrom
street-abbreviations-981

Conversation

@brawer

@brawer brawer commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Requested by Sascha · project thread

Closes #981.

What it does

  • New matchers::street: compares street names word by word. Two words are the same if libpostal's address dictionaries list them on one line, for example str./straße, rd/road, av/avenida, n/north, ul/ulica. This isn't transitive: st matches street and saint, but those two don't match each other. Separable suffixes are split off, so Nussdorferplatz = Nussdorfer Platz. Accents and ß are folded.
  • addr:street evidence (match.evidence.agreeing, spider-stats) uses it.
  • The address check that far (> 150 m) contact, brand-name and brand-domain matches must pass also accepts the OSM street when it appears this way in the ATP address. Before, 280 S. Washington St. failed against South Washington Street.
  • Only libpostal's text dictionaries are vendored (MIT, 93 KB), as src/matchers/street_abbreviations.txt. They're generated by scripts/generate_street_abbreviations.py from a pinned libpostal checkout. There is no C library and no model. The dictionaries are listed in the SBOM as libpostal-dictionaries. I checked the jq change with jq 1.8.1 on a small input.

Evaluation

Tag agreement, planet (production output 2026-11-09, 58,416 matches with addr:street on both sides): agreement goes from 48.9% (#980) to 71.1%, which is +12,987 streets. The biggest gains are DE (+7.2k, mostly maes_dkv Str.), AT, US, ZA and FR. A random sample of 150 newly agreeing rows had 150/150 right.

Matching, regional A/B runs (same binary with the dictionaries on and off, ATP 2026-11-07):

region matches off → on addr:street agreeing
US: Massachusetts 7,499 → 7,501 19 → 75
Germany: Berlin 6,108 → 6,108 302 → 477
Switzerland 66,124 → 66,126 658 → 851
Brazil: Sudeste 6,302 → 6,304 121 → 173

All six new matches are right, for example Av Ayrton Senna, 3243 / Avenida Ayrton Senna and Ch Grély 18 / Chemin Grély. None was lost or moved, and the conflate step's run time is unchanged. The matching effect is small because addresses only gate non-wikidata matches beyond 150 m.

Tests

cargo test --lib: 484 passed, and clippy is clean. The integration tests need tippecanoe, which the sandbox lacks, so CI covers them.


Generated by Claude Code

Compare street names word by word, where two words are the same if
libpostal's address dictionaries list them on one line, such as
`str.` and `straße`, `rd` and `road`, `av` and `avenida`. Separable
suffixes are split off (`Nussdorferplatz` = `Nussdorfer Platz`), and
accents and `ß` are folded. The dictionaries (MIT) are vendored as
src/matchers/street_abbreviations.txt by a new generator script, and
listed in the SBOM.

This is used for the `addr:street` evidence and in the address check
that far contact and brand-name matches must pass.

Closes #981

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ttfb2JTNAMoqAQXFFQ4fad
@brawer brawer self-assigned this Nov 17, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Nov 17, 2026
@brawer
brawer merged commit 8d08006 into main Nov 17, 2026
9 checks passed
@brawer
brawer deleted the street-abbreviations-981 branch November 17, 2026 03:21
brawer added a commit that referenced this pull request Nov 17, 2026
Write up what #980 (postcodes, house numbers in addr:street) and #982
(street abbreviations from libpostal's dictionaries) changed, with the
planet tag-agreement numbers, the regional matching runs, the Japanese
postcode formats, and what is still left open.


Claude-Session: https://claude.ai/code/session_01Ttfb2JTNAMoqAQXFFQ4fad

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evidence: expand street abbreviations (Str. / Straße, Rd / Road) before comparing addr:street

2 participants