def is_found_with_aho_corasick(secret, automaton):
    """
    :type secret: str

    :type automaton: ahocorasick.Automaton|None
    :param automaton: optional automaton for ignoring certain words.

    :rtype: bool
    Returns True if secret contains a word in the automaton.
    """
    if not automaton:
        return False

    try:
        # .lower() to make everything case-insensitive
        next(automaton.iter(string=secret.lower()))
        return True
    except StopIteration:
        return False