feat(normalizer): year expansion century rule

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-25 13:27:26 +02:00
parent 4845e7a3c1
commit 1908dde859
2 changed files with 31 additions and 0 deletions

View File

@@ -24,3 +24,15 @@ def test_resolve_season():
def test_resolve_unknown_token_returns_none():
assert dates.resolve_feast_or_season("Freitag", 1919) is None
def test_expand_year():
assert dates.expand_year("1888") == 1888
assert dates.expand_year("889") == 1889 # 3-digit -> 1DDD
assert dates.expand_year("923") == 1923
assert dates.expand_year("08") == 1908 # 00..57 -> 19xx
assert dates.expand_year("17") == 1917
assert dates.expand_year("57") == 1957
assert dates.expand_year("73") == 1873 # 73..99 -> 18xx
assert dates.expand_year("99") == 1899
assert dates.expand_year("65") is None # 58..72 ambiguous
assert dates.expand_year("x") is None