import string


def char2inversed_id(char):
    """ Converts char to id (int) with one-hot encoding handling of unexpected characters"""
    if char in string.ascii_lowercase:
        return 97 + (122 - ord(char))
    elif char in string.ascii_lowercase:
        return 65 + (90 - ord(char))
    else: # pass other characters normally
        return ord(char)