From 1df9bdc5ab323bdbc454539293b1539e76802d96 Mon Sep 17 00:00:00 2001 From: calebchiam Date: Mon, 18 Jul 2022 12:15:34 +0300 Subject: [PATCH] fix import for emoji==2.0.0 --- cleantext/clean.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cleantext/clean.py b/cleantext/clean.py index 50ddcb8..4c758a0 100644 --- a/cleantext/clean.py +++ b/cleantext/clean.py @@ -7,7 +7,7 @@ import sys from unicodedata import category -from emoji import UNICODE_EMOJI, demojize, emojize +from emoji import EMOJI_DATA, demojize, emojize from ftfy import fix_text from . import constants @@ -196,7 +196,8 @@ def remove_punct(text): def remove_emoji(text): - return remove_substrings(text, UNICODE_EMOJI["en"]) + emoji_data_en = {k: v['en'] for k, v in EMOJI_DATA.items()} + return remove_substrings(text, emoji_data_en) def clean(