fix(normalizer): don't convert plausible typo years as Excel serials

This commit is contained in:
Marcel
2026-05-25 20:46:42 +02:00
parent 9ae1196d1c
commit 443c7a48db
2 changed files with 40 additions and 11 deletions

View File

@@ -52,3 +52,10 @@ def test_parse_year_unresolvable_truncated():
def test_parse_year_typo_year():
# "4.3.1023" — year 1023 outside 1500-2100 guard — returns None
assert persons_tree._parse_year("4.3.1023") is None
def test_parse_year_bare_out_of_range_year_is_none():
# "1023" is a plausible typo for "1923" but is NOT an Excel serial.
# parse_date("1023") parses it as year 1023 (out of 1700-2100 guard).
# The serial branch must NOT re-interpret it as a serial.
assert persons_tree._parse_year("1023") is None