How to use the emot.emo_unicode.EMOTICONS_EMO 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 NeelShah18 / emot / emot / core.py View on Github external
'''
    __entities = []
    flag = True
    try:
        pattern = u'(' + u'|'.join(k for k in emo_unicode.EMOTICONS) + u')'
        __entities = []
        __value = []
        __location = []
        matches = re.finditer(r"%s"%pattern,str(string))
        for et in matches:
            __value.append(et.group().strip())
            __location.append([et.start(),et.end()])
            
        __mean = []
        for each in __value:
            __mean.append(emo_unicode.EMOTICONS_EMO[each])
        
        if len(__value) < 1:
            flag = False
        __entities = {
        'value' : __value,
        'location' : __location,
        'mean' : __mean,
        'flag' : flag
        }
    except Exception as e:
        __entities = [{'flag' : False}]
        #print("No emoiticons found")
        return __entities

    return __entities

emot

Emoji and Emoticons detection package for Python

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis