From 80f3325cf07c7a5820f3efaa1bc1e34f628cead2 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 22 Jan 2026 09:08:15 +0000 Subject: [PATCH] =?UTF-8?q?Detect=20block-level=20asset=20conditions=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../records/peabody/peabody_asset_condition.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/backend/condition/parsing/records/peabody/peabody_asset_condition.py b/backend/condition/parsing/records/peabody/peabody_asset_condition.py index 5451d570..71fa1e9d 100644 --- a/backend/condition/parsing/records/peabody/peabody_asset_condition.py +++ b/backend/condition/parsing/records/peabody/peabody_asset_condition.py @@ -1,3 +1,5 @@ +import re + from dataclasses import dataclass from datetime import datetime from typing import Optional @@ -23,4 +25,15 @@ class PeabodyAssetCondition: @property def is_block_level(self) -> bool: - raise NotImplementedError \ No newline at end of file + if not self.full_address: + return False + + address = self.full_address.upper() + + block_level_patterns = [ + r"\bBLOCK\b", # "BLOCK MILNE HOUSE" + r"\bFLATS\b", # "FLATS A-D ..." + r"\b\d+[A-Z]?-\d+[A-Z]?\b", # "1-80", "9A-9H" + ] + + return any(re.search(pattern, address) for pattern in block_level_patterns) \ No newline at end of file