+1
-10
@@ -64,16 +64,7 @@ def is_mixed(text: str) -> bool:
|
|||||||
word = word.strip()
|
word = word.strip()
|
||||||
if not word:
|
if not word:
|
||||||
continue
|
continue
|
||||||
rus_counts = eng_counts = any_counts = 0
|
if any(e in ONLY_RUS_LETTERS for e in word) and any(e in ONLY_ENG_LETTERS for e in word):
|
||||||
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
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user