feat(normalizer): add generation parser to persons_tree

This commit is contained in:
Marcel
2026-05-25 20:54:38 +02:00
parent 889d301f16
commit 47a0770758
2 changed files with 32 additions and 0 deletions

View File

@@ -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