import re


def _shape(word):
    """ This function returns a characteristic of the word, in a sense it tells
    if it is made solely of numbers, if it's upper or lower case, punctuations...
    We identifiy:
    0-None   1-number   2-punct   3-upcase   4-downcase   5-mixedcase   6-other
    """
    if word == None:
        shape_case = "0"   # ''
    elif re.match('[0-9]+(\.[0-9]*)?|[0-9]*\.[0-9]+$', word):
        shape_case = "1"   # 'number'
    elif re.match('\W+$', word):
        shape_case = "2"   # 'punct'
    elif re.match('[A-Z][a-z]+$', word):
        shape_case = "3"   # 'upcase'
    elif re.match('[a-z]+$', word):
        shape_case = "4"   # 'downcase'
    elif re.match('\w+$', word):
        shape_case = "5"   # 'mixedcase'
    else:
        shape_case = "6"   # 'other'
    return shape_case