utils.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:LinguisticAnalysis 作者: DucAnhPhi 项目源码 文件源码
def remove_emoticons(text):
    # build regexp with imported emoticon list
    smileys = '|'.join(map(re.escape, emoticons))
    emoticonsPattern = re.compile('({})'.format(smileys), flags=re.IGNORECASE)
    removed = re.sub(emoticonsPattern, '', text)
    # remove unnecessary white spaces utilizing the TweetTokenizer
    removed = tokenize(removed)
    return " ".join(sum(removed, []))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号