Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def replace(match):
codes_dict = unicode_codes.UNICODE_EMOJI_ALIAS if use_aliases else unicode_codes.UNICODE_EMOJI
val = codes_dict.get(match.group(0), match.group(0))
return delimiters[0] + val[1:-1] + delimiters[1]
def getEntries(self):
entryList = []
for emoji, code in sorted(unicode_codes.UNICODE_EMOJI.items()):
entryList.append([emoji, '{0} {1}'.format(emoji, code)])
return entryList
def has_emoji(text: str) -> bool:
return any(c in emoji.unicode_codes.UNICODE_EMOJI for c in text)
def emoji_count(string):
"""Returns the count of emojis in a string"""
c=0
for i in string:
if i in unicode_codes.UNICODE_EMOJI:
c=c+1
return(c)
def replace_emoji(x):
if x in UNICODE_EMOJI.keys():
return ' ' + UNICODE_EMOJI[x].replace(':', '@') + ' '
else:
return x
def replace_emoji(x):
if x in UNICODE_EMOJI.keys():
return ' ' + UNICODE_EMOJI[x].replace(':', '@') + ' '
else:
return x