Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

converting emoji to Arabic text in python

I have an Arabic string which has emoji and I want to convert them to text, I've found a function converts them to text but in English. How can I convert emoji to Arabic text? here is my string and code:

my string: ????? ????? ?????? ??? ????????

after converting emoji: ????? ????? ?????? ??? two_hearts two_hearts two_hearts two_hearts

import emoji
st="????? ????? ?????? ???  ????????"
st=emoji.demojize(st, delimiters=(" ", " "))
print(st)

thank you for your help.

question from:https://stackoverflow.com/questions/65644494/converting-emoji-to-arabic-text-in-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

?? in Python source code is u"U0001F495" so maybe you can try something with that?

edit: read op's post again.

so i found a site that translates emojis to any language if ????? is ?? maybe check it out / emojitranslate . com

i wonder if an api is the best way or maybe somehow importing a table of emoji conversions


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...