fix(normalizer): keep Task 5 scoped — drop year-only matcher (belongs to Task 8)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -116,17 +116,8 @@ def _match_numeric(s):
|
||||
return None
|
||||
|
||||
|
||||
_YEAR_ONLY_RE = re.compile(r"\d{4}")
|
||||
|
||||
|
||||
def _match_year_only(s):
|
||||
if _YEAR_ONLY_RE.fullmatch(s):
|
||||
return datetime.date(int(s), 1, 1).isoformat(), Precision.YEAR
|
||||
return None
|
||||
|
||||
|
||||
# Matchers are tried in order. Later tasks append to this list.
|
||||
_MATCHERS = [_match_iso, _match_numeric, _match_year_only]
|
||||
_MATCHERS = [_match_iso, _match_numeric]
|
||||
|
||||
|
||||
def parse_date(raw: str, date_overrides: dict | None = None) -> ParsedDate:
|
||||
|
||||
Reference in New Issue
Block a user