def is_punctuation(token):
    '''
    Returns whether a given word is punctuation according to 
    unicode punctuation categories.     
    '''
    # codes for unicode punctuation categories 
    unicode_punctuation = set(['Pc', 'Pd', 'Pe', 'Pf', 'Pi', 'Po', 'Ps'])
    for char in token.word:
        if ud.category(char) not in unicode_punctuation:
            return False
    
    return True
dataset/ETHPy150Open erickrf/nlpnet/bin/nlpnet-test.py/is_punctuation/original