mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Resolve an address to its unambiguous historic EPC UPRN 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b8c376bfd6
commit
b47c90f9cd
1 changed files with 8 additions and 1 deletions
|
|
@ -38,4 +38,11 @@ class HistoricEpcResolver:
|
|||
) -> Optional[tuple[str, str, float]]:
|
||||
"""``(uprn, matched_address, lexiscore)`` for an unambiguous rank-1
|
||||
match, else None (no data / ambiguous tie / zero score)."""
|
||||
raise NotImplementedError
|
||||
matches = self.match(user_address, postcode)
|
||||
uprn = matches.unambiguous_uprn()
|
||||
if not uprn or uprn == "nan":
|
||||
return None
|
||||
top = matches.top()
|
||||
if top is None:
|
||||
return None
|
||||
return uprn, top.record.address, top.lexiscore
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue