'If key is an int, returns whether the key is in the indices.
If key is a str, return if the token is in the dict of tokens.'

def __contains__(self, key):

    if (type(key) == int):
        return (key in self.ind2tok)
    elif (type(key) == str):
        return (key in self.tok2ind)
