fabriquedoc-backend/extract_emojis.py
2023-05-17 15:53:44 -04:00

13 lines
312 B
Python

import emoji
def replace_emojis(input_text):
'''
Replaces emojis in text with a custom LaTeX sequence.
:param input_text:
:return:
'''
for char in input_text:
if emoji.is_emoji(char):
input_text = input_text.replace(char, f"\\emoji{{{char}}}")
return input_text