def modifies(g, n, modifiers):
    """
    Tests whether any of the modifiers of node n are in
    any of the categories listed in 'modifiers'
    """
    pred = g.predecessors(n)
    if not pred:
        return False
    pcats = []
    for p in pred:
        pcats.extend(p.getCategory())
    return bool(set(pcats).intersection([m.lower() for m in modifiers]))