def word2wid(word, word2id_dict, OOV="<oov>"):
    """
    Transform single word to word index.
    :param word: a word
    :param word2id_dict: a dict map words to indexes
    :param OOV: a token that represents Out-of-Vocabulary words
    :return: int index of the word
    """
    for each in (word, word.lower(), word.capitalize(), word.upper()):
        if each in word2id_dict:
            return word2id_dict[each]
    return word2id_dict[OOV]