def __init__(self,node=None,type='NAF'):
        """
        Constructor of the object
        @type node: xml Element or None (to create and empty one)
        @param node:  this is the node of the element. If it is None it will create a new object
        @type type: string
        @param type: the type of the object (KAF or NAF)
        """
        self.type = type
        self.idx = {}
        if node is None:
            self.node = etree.Element('srl')
        else:
            self.node = node
            for node_pred in self.__get_node_preds():
                pred_obj = Cpredicate(node_pred)
                self.idx[pred_obj.get_id()] = node_pred
            
        # Create a mapping role id --> node
        self.map_roleid_node = {}
        for predicate in self.get_predicates():
            for role in predicate.get_roles():
                self.map_roleid_node[role.get_id()] = role.get_node()
def __init__ ( self , node = None , type = 'NAF' ) : self . type = type self . idx = { } if node is None : self . node = etree . Element ( 'srl' ) else : self . node = node for node_pred in self . __get_node_preds ( ) : pred_obj = Cpredicate ( node_pred ) self . idx [ pred_obj . get_id ( ) ] = node_pred self . map_roleid_node = { } for predicate in self . get_predicates ( ) : for role in predicate . get_roles ( ) : self . map_roleid_node [ role . get_id ( ) ] = role . get_node ( )
Constructor of the object
        @type node: xml Element or None (to create and empty one)
        @param node:  this is the node of the element. If it is None it will create a new object
        @type type: string
        @param type: the type of the object (KAF or NAF)