How can I replace the emoji by their meaning?
tashiq opened this issue · comments
Well! I want to replace emojis with their meaning. Can I solve this problem by emot?.
or I have to look for other packages. If so, will you please elaborate on this?
For emoji please see as below:
import emot
text = "I love python 👨 :-)"
emot.emoji(text)
[{'value': '👨', 'mean': ':man:', 'location': [14, 14], 'flag': True}]
emot.emoticons(text)
{'value': [':-)'], 'location': [[16, 19]], 'mean': ['Happy face smiley'], 'flag': True}
Library will return the dictionary with value, what you can do is two thing:
- Pass only one word and replace meaning if flag is True.
- Else you can pass whole text and change the text at specific location through meaning and location information.
Normally 1st option is much more easy to do.
No, there is no issue. I solved this using your code segment. Thanks <3
Information provided :-)