def filter_soundex(word, code=None):
    """Get soundex value, checking result against a given code.

    :param word (str): The word.
    :param code (str, optional): The soundex pronunciation code.