This commit is contained in:
Andras Schmelczer 2026-07-03 18:01:10 +01:00
parent c2070693fb
commit 909e241907
55 changed files with 594 additions and 223 deletions

View file

@ -113,7 +113,7 @@ def fuzzy_join_on_postcode(
``_match_score``) null. This turns "price-paid LEFT JOIN epc" into a union
that also surfaces EPC-only dwellings (an energy certificate but no Land
Registry sale). It assumes ``right`` is already unique on its match key
(address + postcode) as the deduped EPC frame is so each unmatched right
(address + postcode), as the deduped EPC frame is, so each unmatched right
row appears once.
"""
@ -308,7 +308,7 @@ def _numbers_compatible(a: str, b: str) -> bool:
Equality, not subset: subset logic let "188 GREAT NORTH WAY" absorb
"FLAT 1 188 GREAT NORTH WAY" ({188} is a subset of {1, 188}), attaching a
single flat's EPC facts to the whole building tens of thousands of
single flat's EPC facts to the whole building: tens of thousands of
wrong-property matches. Likewise digit-only tokens made "8A" and "8B"
both look like {8} and match each other (and plain "8"), and ungated
letter flats let "FLAT D 39 X ST" cross-match "FLAT F 39 X ST" at ~96.
@ -332,7 +332,7 @@ def _admissible_variants(
"""Variants of ``primary`` that are safe to score against the other side.
A variant may only ADD or DROP whole tokens relative to the primary (one
word multiset must contain the other) never substitute, so a register
word multiset must contain the other), never substitute, so a register
row whose address lines disagree with the combined address can't smuggle
in a different street. The number gate runs on the primary addresses
only, so the added/dropped tokens must additionally carry no digits

View file

@ -12,7 +12,7 @@ import re
import polars as pl
# One character outside [a-z0-9 ]. Callers lowercase first; each offending
# character becomes a single space (runs are NOT merged here callers apply
# character becomes a single space (runs are NOT merged here; callers apply
# word-level rules and then collapse_whitespace).
_NON_ALNUM_LOWER_RE = re.compile(r"[^a-z0-9 ]")