feat(normalizer): add generation parser to persons_tree
This commit is contained in:
@@ -66,3 +66,11 @@ def _parse_year(raw: str | None) -> int | None:
|
||||
return d.year
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def _parse_generation(raw: str | None) -> int | None:
|
||||
"""Extract the generation integer from column A values like 'G 3', 'G3', 'G 0'."""
|
||||
if not raw:
|
||||
return None
|
||||
m = re.search(r"\d+", str(raw))
|
||||
return int(m.group()) if m else None
|
||||
|
||||
Reference in New Issue
Block a user