mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
feat: Update year normalization logic to reflect US-style pronunciation for years 1100-1999; adjust related tests for consistency
This commit is contained in:
@@ -92,7 +92,8 @@ def update_settings() -> ResponseReturnValue:
|
||||
for key in _NORMALIZATION_BOOLEAN_KEYS:
|
||||
current[key] = _extract_checkbox(key, bool(current.get(key, True)))
|
||||
for key in _NORMALIZATION_STRING_KEYS:
|
||||
current[key] = (form.get(key) or "").strip()
|
||||
if hasattr(form, "__contains__") and key in form:
|
||||
current[key] = (form.get(key) or "").strip()
|
||||
|
||||
# Integrations
|
||||
current["integrations"] = current.get("integrations", {})
|
||||
|
||||
@@ -316,6 +316,12 @@ def normalize_setting_value(key: str, value: Any, defaults: Dict[str, Any]) -> A
|
||||
if normalized_mode in {"off", "spacy", "llm"}:
|
||||
return normalized_mode
|
||||
return defaults[key]
|
||||
if key == "normalization_numbers_year_style":
|
||||
if isinstance(value, str):
|
||||
normalized_style = value.strip().lower()
|
||||
if normalized_style in {"american", "off"}:
|
||||
return normalized_style
|
||||
return defaults[key]
|
||||
if key == "llm_context_mode":
|
||||
if isinstance(value, str):
|
||||
normalized_scope = value.strip().lower()
|
||||
|
||||
Reference in New Issue
Block a user