feat: refine assistant logic and update docs

This commit is contained in:
future
2026-04-09 21:03:02 +03:00
parent ebe79c3692
commit 42c064a274
19 changed files with 1958 additions and 492 deletions

View File

@@ -342,6 +342,7 @@ def numbers_to_words(text: str) -> str:
case = "nominative"
gender = "m"
prep_clean = prep.strip().lower() if prep else None
parsed = None
if prep_clean:
morph_case = get_case_from_preposition(prep_clean)
@@ -359,6 +360,7 @@ def numbers_to_words(text: str) -> str:
# Спец-случай: "на 1 час"
if (
prep_clean == "на"
and parsed is not None
and parsed.normal_form in TIME_UNIT_LEMMAS
and parsed.tag.gender in ("masc", "neut")
):