def replace_unknown_token(token, dictionary):
    """ Checks whether the token is in the given dictionary.
    If not it is replaced by an UNK token
    
    Arguments:
        token {string} -- the token to be checked and eventually replaced
        dictionary {dict} -- the dictionary
    
    Returns:
        string -- the new token
    """

    if token not in dictionary:
        return "_unk_"
    return token