Фикс произношения дат и температуры + wheather -лишние файлы

This commit is contained in:
2026-01-10 23:50:02 +03:00
parent 3818f0ad22
commit 8f44fd2460
10 changed files with 295 additions and 82 deletions

View File

@@ -237,7 +237,7 @@ def numbers_to_words(text: str) -> str:
preps_list = "|".join(map(re.escape, PREPOSITION_CASES.keys()))
text = re.sub(
rf"(?i)\b((?:{preps_list})\s+)?(\d+(?:[.,]\d+)?)(?=(\s+[а-яА-ЯёЁ]+))?\b",
rf"(?i)(?<!\w)((?:{preps_list})\s+)?([+-]?\d+(?:[.,]\d+)?)(?=(\s+[а-яА-ЯёЁ]+))?\b",
replace_cardinal_match,
text,
)