如何在字符串(python、perl)中找到表情符号、unicode字符和表情符号的文本描述?

如何在字符串(python、perl)中找到表情符号、unicode字符和表情符号的文本描述?,python,regex,perl,unicode,emoticons,Python,Regex,Perl,Unicode,Emoticons,表情图标的检测和计数已得到解决 作为这个问题和提供的解决方案的后续工作,我想扩展它,使其能够将检测到的表情符号、unicode字符和表情符号链接到相应的(文本)描述: 表情符号(西方和东方,如维基百科中的表情符号列表) unicode字符(如U1F600.pdf,可从unicode网站获得(直接链接包含在上述stackoverflow问题中) 其他表情符号类型,例如Twitter中常用的表情符号列表(emojipedia网站上的Twitter表情符号列表) 在python或perl中,是否已

表情图标的检测和计数已得到解决

作为这个问题和提供的解决方案的后续工作,我想扩展它,使其能够将检测到的表情符号、unicode字符和表情符号链接到相应的(文本)描述:

  • 表情符号(西方和东方,如维基百科中的表情符号列表)
  • unicode字符(如U1F600.pdf,可从unicode网站获得(直接链接包含在上述stackoverflow问题中)
  • 其他表情符号类型,例如Twitter中常用的表情符号列表(emojipedia网站上的Twitter表情符号列表)
在python或perl中,是否已经有类似于在中实现的方法的全面解决方案可用于执行此类转换? 如果没有,您能否制作一个脚本,为字符串中的表情符号/表情符号提供文本描述?

perl示例使用:

使用5.014;
严格使用;
使用警告;
使用utf8;
使用开放式qw(:标准:utf8);
使用字符名“:full”;
my@faces=split/,“Python具有包含所有Unicode字符数据的导入模块:

输出:


很高兴知道这一点,+1
use 5.014;
use strict;
use warnings;
use utf8;
use open qw(:std :utf8);
use charnames ':full';

my @faces = split //, 'Python has the 
unicodedata
import module with data on all the Unicode characters:

import unicodedata as ud
s = '\U0001F604\U0001F600\U0001F608'
for c in s:
    print('{} U+{:5X} {}'.format(c,ord(c),ud.name(c)))