def to_index(c):
    """
    Returns the sequence/index corresponding to a character. e.g. A -> 1, B -> 2
    :param c:
    :return:
    """
    index = 0
    if type(c) == str:
        if c.isupper():
            index = ord(c) - 64
        else:
            index = ord(c) - 96
    return index