不能处理表情吗?根据unicode提供的描述,使用此选项将它们视为纯字符串。
emoji2text的Python项目详细描述
拿一根有表情符号的绳子。将它们转换为基于文本的 名字。
fromemoji2textimportemoji2textemoji2text(""" Take a ? of emoji like ?, ? or ? and convert them to ? ? and you'll be feeling all ?? ?? ?? ?? ? ?! """)# Take a wrapped gift of emoji like avocado, disappointed face or face vomiting# and convert them to input latin uppercase input latin lowercase# and you'll be feeling all# raising hands: medium-dark skin tone flexed biceps: light skin tone woman scientist man technologist hundred points confetti ball!
您还可以将它们包装起来,以帮助区分每个表情符号,如下所示:
emoji2text("????",":")# :grinning face::face with tears of joy::face with tears of joy::smiling face with sunglasses:emoji2text("????","<",">")# <grinning face><face with tears of joy><face with tears of joy><smiling face with sunglasses>
要安装,请使用pip
pip install emoji2text
仅支持Python3和Emoji版本5.0(2017)。如果有人是 对增加支持感兴趣,我很乐意查看任何公关。
如果发现任何错误,请创建一个输入失败的问题,然后 预期结果。
只有在非常有帮助的情况下才有可能 grapheme模块。