Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def emoji(string):
'''emot.emoji is use to detect emoji from text
>>> text = "I love python 👨 :-)"
>>> emot.emoji(text)
>>> {'value': ['👨'], 'mean': [':man:'], 'location': [[14, 14]], 'flag': True}
'''
__entities = {}
__value = []
__mean = []
__location = []
flag = True
try:
pro_string = str(string)
for pos,ej in enumerate(pro_string):
if ej in emo_unicode.UNICODE_EMO:
try:
__value.append(ej)
__mean.append(emo_unicode.UNICODE_EMO[ej])
__location.append([pos,pos])
except Exception as e:
flag = False
__entities.append({"flag": False})
return __entities
except Exception as e:
flag = False
__entities.append({"flag": False})
return __entities
if len(__value) < 1:
flag = False
__entities = {