удаление @username из всего текста, замена Конец сообщения на Пип
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 29s
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 29s
This commit is contained in:
parent
50e7cea1f5
commit
39f10be7fd
1 changed files with 2 additions and 1 deletions
|
|
@ -66,11 +66,12 @@ def get_ogg_duration(path: str) -> int:
|
|||
|
||||
def clean_text(text: str) -> str:
|
||||
text = emoji.replace_emoji(text, '')
|
||||
text = re.sub(r'@\S+\s*', '', text)
|
||||
text = re.sub(r'[ \t]+', ' ', text)
|
||||
text = re.sub(r'\n{2,}', '\n', text)
|
||||
text = text.strip()
|
||||
if text:
|
||||
text += '\nКонец сообщения.'
|
||||
text += '\nПип.'
|
||||
return text
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue