From 258c9102fcaa5be160808cfa2f30f9a7b97a54a6 Mon Sep 17 00:00:00 2001 From: kotolex Date: Fri, 10 Jan 2025 18:24:51 +0500 Subject: [PATCH] FIX: mixed is back --- src/helpers.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/helpers.py b/src/helpers.py index 5bdb0c3..51a06b8 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -64,17 +64,8 @@ def is_mixed(text: str) -> bool: word = word.strip() if not word: continue - rus_counts = eng_counts = any_counts = 0 - for letter in word: - if letter in ONLY_RUS_LETTERS: - rus_counts += 1 - elif letter in ONLY_ENG_LETTERS: - eng_counts += 1 - elif letter not in SYMBOLS: - any_counts += 1 - if (rus_counts > 0 and eng_counts > 0) or (rus_counts > 0 and any_counts > 0) or ( - eng_counts > 0 and any_counts > 0): - return True + if any(e in ONLY_RUS_LETTERS for e in word) and any(e in ONLY_ENG_LETTERS for e in word): + return True return False