我试着用他们的意思代替表情符号。
Tweets$text[19]
"I ❤️ flying . ☺️\U0001f44d"
对于这个任务,我使用textclean
包。词典不仅包括表情符号描述,还包括字节码表示(x:列):
hash_emojis[1:3]
x y
1: <e2><86><95> up-down arrow
2: <e2><86><99> down-left arrow
3: <e2><86><a9> right arrow curving left
结果如下:
Tweets$text[19] = replace_emoji(Tweets$text[19], emoji_dt = lexicon::hash_emojis)
Tweets$text[19]
"I red heart <ef><b8><8f> flying . smiling face <ef><b8><8f> thumbs up "
我只想获得没有字节码表示的描述,因为我必须再次清理它。如何将"y列“仅应用于文本?他们可能是处理R中表情符号的更好方法吗?
发布于 2018-08-28 14:27:45
在使用replace_emoji
之后,您可以使用replace_non_ascii
来消除ascii代码。
text <- "I ❤️ flying . ☺️\U0001f44d"
t <- replace_emoji(text)
replace_non_ascii(t)
"I red heart flying . smiling face thumbs up"
https://stackoverflow.com/questions/52060107
复制相似问题