def corefNode(parseinfo, mention):
    """
    Returns the best node in the tree that matches the mention
    """
    sentence = parseinfo.sentence(mention.sentence)
    tree = sentence.parseTree()
    for st in tree.subtrees():
        # print st.tag(), st.token_range(), (mention.start, mention.end)==st.token_range()
        if (mention.start, mention.end)==st.token_range():
            return st
    # nothing found that matches exactly --- should not happen
    return None