How to use the emot.emoticons function in emot

To help you get started, we’ve selected a few emot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nouhadziri / THRED / thred / util / nlp.py View on Github external
def _strip_emoticons(text):
    global UNCOMMON_EMOTICONS

    tokens = tweet_tokenize(text)

    emoticons = set()
    for token in tokens:
        for em in emot.emoticons(token):
            emoticon = em['value']
            if emoticon in ('(', ')', ':') or emoticon != token:
                continue
            emoticons.add(emoticon)

        if Emoticon_RE.match(token) or token in (':*(',):
            emoticons.add(token)

    for em in UNCOMMON_EMOTICONS:
        if em in text:
            emoticons.add(em)

    normalized = text
    for emoticon in emoticons:
        if re.match(r'^[a-zA-Z0-9]+$', emoticon.lower()):
            continue

emot

Emoji and Emoticons detection package for Python

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis