bsolomon1124 / demoji

Accurately find/replace/remove emojis in text strings
https://pypi.org/project/demoji/
Apache License 2.0
157 stars 20 forks source link

Replace emoji with description #9

Closed bmabir17 closed 4 years ago

bmabir17 commented 4 years ago

Is your feature request related to a problem? Please describe. I am trying to replace the emoji found with description given in the demoji.findall(tweet) { "šŸ”„": "fire", "šŸŒ‹": "volcano", "šŸ‘ØšŸ½\u200dāš–ļø": "man judge: medium skin tone", "šŸŽ…šŸ¾": "Santa Claus: medium-dark skin tone", "šŸ‡²šŸ‡½": "flag: Mexico", "šŸ‘¹": "ogre", "šŸ¤”": "clown face", "šŸ‡³šŸ‡®": "flag: Nicaragua", "šŸš£šŸ¼": "person rowing boat: medium-light skin tone", "šŸ‚": "ox", } Describe the solution you'd like I have a string with emoji : Rooney ! Oh dear, oh dear ! Fucking dreadful šŸ™ˆāš½ļøāš½ļø

I want to make it like this: Rooney ! Oh dear, oh dear ! Fucking dreadful 'see-no-evil monkey' 'soccer ball' 'soccer ball'

Describe alternatives you have considered

emo_dict=demoji.findall(emoticonString)
for key in emo_dict.keys():
    emoticonString=emoticonString.replace(key, emo_dict[key])
davidagud commented 4 years ago

@bmabir17 I just created a pull request with a function that would allow for this, but it would look like "Rooney ! Oh dear, oh dear ! Fucking dreadful :see-no-evil monkey: :soccer ball: :soccer ball:

bmabir17 commented 4 years ago

@davidagud Thank you for the pull request https://github.com/bsolomon1124/demoji/pull/10

davidagud commented 4 years ago

@bmabir17 @bsolomon1124 Just created a pull request with the updated code.

bsolomon1124 commented 4 years ago

Closed in PR #12 .