predpatt/filters.py
def isGoodAncestor(pred):
    """
    Returns true if verb is not dominated by a relation
    that might alter its veridicality. This filter is very
    conservative; many veridical verbs will be excluded.
    """
    # Move to ud_filters
    # Technically, conj shouldn't be a problem, but
    # some bad annotations mean we need to exclude it.
    #   ex. "It is a small one and easily missed" ("missed" has
    #   "one" as a head with relation "conj")
    embedding_deps = {"acl", "mwe", "ccomp", "xcomp", "advcl",
                      "acl:relcl", "case", "conj", "parataxis", "csubj",
                      "compound", "nmod"}
    pointer = pred.root # index of predicate
    while pointer.gov_rel != u'root':
        if pointer.gov_rel in embedding_deps:
            return False
        # Replace pointer with its head
        pointer = pointer.gov
    filter_rules = getattr(pred, 'rules', [])
    filter_rules.append(isGoodAncestor.__name__)
    return True

    Returns true if verb is not dominated by a relation
    that might alter its veridicality. This filter is very
    conservative; many veridical verbs will be excluded.
    
Returns true if verb is not dominated by a relation
that might alter its veridicality. This filter is very
conservative; many veridical verbs will be excluded.
Returns true if verb is not dominated by a relation that might alter its veridicality . This filter is very conservative ; many veridical verbs will be excluded .
def isGoodAncestor(pred):
    embedding_deps = {"acl", "mwe", "ccomp", "xcomp", "advcl",
                      "acl:relcl", "case", "conj", "parataxis", "csubj",
                      "compound", "nmod"}
    pointer = pred.root 
    while pointer.gov_rel != u'root':
        if pointer.gov_rel in embedding_deps:
            return False
        pointer = pointer.gov
    filter_rules = getattr(pred, 'rules', [])
    filter_rules.append(isGoodAncestor.__name__)
    return True
def isGoodAncestor ( pred ) : embedding_deps = { "acl" , "mwe" , "ccomp" , "xcomp" , "advcl" , "acl:relcl" , "case" , "conj" , "parataxis" , "csubj" , "compound" , "nmod" } pointer = pred . root while pointer . gov_rel != u'root' : if pointer . gov_rel in embedding_deps : return False pointer = pointer . gov filter_rules = getattr ( pred , 'rules' , [ ] ) filter_rules . append ( isGoodAncestor . __name__ ) return True
Returns true if verb is not dominated by a relation
that might alter its veridicality.
Returns true if verb is not dominated by a relation that might alter its veridicality .
"""
    Returns true if verb is not dominated by a relation
    that might alter its veridicality. This filter is very
    conservative; many veridical verbs will be excluded.
    """ # Move to ud_filters # Technically, conj shouldn't be a problem, but # some bad annotations mean we need to exclude it. #   ex. "It is a small one and easily missed" ("missed" has #   "one" as a head with relation "conj") # index of predicate # Replace pointer with its head
pred