def get_interpret_as(self, elem) :
    """ Returns a name of a rule based on the interpret_as element if such is valid
    for this element. Otherwise returns None. """
    cur = elem
    while (cur is not None and cur.tag != "say_as") :
        cur = cur.getparent()
    
    if cur is None: return None

    return cur.attrib.get("interpret_as")