mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
add TODO to is_block_level
This commit is contained in:
parent
b33b69dbce
commit
8cdbe107e5
1 changed files with 9 additions and 6 deletions
|
|
@ -4,6 +4,7 @@ from dataclasses import dataclass
|
|||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@dataclass
|
||||
class PeabodyAssetCondition:
|
||||
lo_reference: str
|
||||
|
|
@ -25,17 +26,19 @@ class PeabodyAssetCondition:
|
|||
|
||||
@property
|
||||
def is_block_level(self) -> bool:
|
||||
# TODO: maybe use block codes from other Peabody dataset to do this instead
|
||||
|
||||
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
|
||||
r"\b\d+[A-Z]-[A-Z]\b", # 81A-B
|
||||
r"\b\d+\s*&\s*\d+\b", # 73 & 74
|
||||
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
|
||||
r"\b\d+[A-Z]-[A-Z]\b", # 81A-B
|
||||
r"\b\d+\s*&\s*\d+\b", # 73 & 74
|
||||
]
|
||||
|
||||
return any(re.search(pattern, address) for pattern in block_level_patterns)
|
||||
return any(re.search(pattern, address) for pattern in block_level_patterns)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue