Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
telegram_bot_antispammer
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иванова Мария Кирилловна
telegram_bot_antispammer
Commits
129d098d
Commit
129d098d
authored
Mar 10, 2025
by
Иванова Мария Кирилловна
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update bot.py
parent
ec68f545
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
bot.py
bot.py
+7
-2
No files found.
bot.py
View file @
129d098d
...
...
@@ -153,13 +153,18 @@ def has_mixed_layout(text):
latin_letters
=
"abcdefghijklmnopqrstuvwxyz"
words
=
text
.
split
()
mixed_words
=
[]
# Список для слов со смешанной раскладкой
for
word
in
words
:
has_cyrillic
=
any
(
char
in
cyrillic_letters
for
char
in
word
.
lower
())
has_latin
=
any
(
char
in
latin_letters
for
char
in
word
.
lower
())
if
has_cyrillic
and
has_latin
:
logger
.
info
(
"Word with mixed layout:
%
s"
,
word
)
return
True
# Найдено слово со смешанной раскладкой
mixed_words
.
append
(
word
)
# Добавляем слово в список
if
len
(
mixed_words
)
>
1
:
logger
.
info
(
"Words with mixed layout:
%
s"
,
", "
.
join
(
mixed_words
))
return
True
# Найдено больше одного слова
return
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment