def char2cid(char, char2id_dict, OOV="<oov>"):
    """
    Transform single character to character index.
    :param char: a character
    :param char2id_dict: a dict map characters to indexes
    :param OOV: a token that represents Out-of-Vocabulary characters
    :return: int index of the character
    """
    if char in char2id_dict:
        return char2id_dict[char]
    return char2id_dict[OOV]