'If key is an int, returns the corresponding token. If it does not
exist, return the unknown token.
If key is a str, return the token\'s index. If the token is not in the
dictionary, return the index of the unknown token. If there is no
unknown token, return ``None``.'

def __getitem__(self, key):

    if (type(key) == int):
        return self.ind2tok.get(key, self.unk_token)
    elif (type(key) == str):
        return self.tok2ind.get(key, self.tok2ind.get(self.unk_token, None))
