feat(normalizer): day-first month-name matcher
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -55,9 +55,9 @@ def test_parse_numeric_unparseable():
|
||||
assert dates.parse_date("13.5.65").precision == Precision.UNKNOWN # ambiguous 2-digit year
|
||||
|
||||
def test_parse_approx_marker_upgrades_precision():
|
||||
r = dates.parse_date("17.Nov (?) 1887") # month-name handled in a later task; here just the marker path
|
||||
r = dates.parse_date("17.Nov (?) 1887") # month-name matcher now active; (?) marks approx
|
||||
assert r.raw == "17.Nov (?) 1887"
|
||||
assert r.precision == Precision.UNKNOWN # no month-name matcher until Task 7; full APPROX check in Task 8
|
||||
assert r.precision == Precision.APPROX # month-name matcher parses date; (?) upgrades to APPROX
|
||||
|
||||
def test_parse_leading_qualifier_is_approx():
|
||||
r = dates.parse_date("nach 1.5.1900") # qualifier stripped, numeric date salvaged, precision APPROX
|
||||
@@ -69,3 +69,12 @@ def test_parse_roman_months():
|
||||
assert dates.parse_date("19.XII.1954").iso == "1954-12-19"
|
||||
assert dates.parse_date("1.III.27").iso == "1927-03-01"
|
||||
assert dates.parse_date("22.III.18").precision == Precision.DAY
|
||||
|
||||
def test_parse_monthname_day_first():
|
||||
assert dates.parse_date("6.März 1888").iso == "1888-03-06"
|
||||
assert dates.parse_date("29.Sept.1891").iso == "1891-09-29"
|
||||
assert dates.parse_date("10.Oct.95").iso == "1895-10-10"
|
||||
assert dates.parse_date("9.December1889").iso == "1889-12-09"
|
||||
assert dates.parse_date("18.Dez.1916").iso == "1916-12-18"
|
||||
assert dates.parse_date("4Dezember 1936").iso == "1936-12-04"
|
||||
assert dates.parse_date("25 August 1968").iso == "1968-08-25"
|
||||
|
||||
Reference in New Issue
Block a user