def __init__(self, salt_document):
        """
        TODO: finish LinguisticDocument.__init__ docstring!
        additional, modified information:
          - adds string onsets/offsets to `TokenNode`s
          - adds the attribute 'self.sentences'
          - adds to each `SpanNode` the `TokenNode`s that belong to it
          - adds to each `TokenNode` the `SpanNode`s that it belongs to

        :param salt_document: SaltDocument

        Attributes
        ----------
        doc_id : str
            the document ID of the Salt document
        edges : list of SaltEdge
            i.e. SaltEdges of type ``TextualRelation``, ``SpanningRelation``
            and ``DominanceRelation``
        layers : list of SaltLayer
        nodes : list of SaltNode
            i.e. SaltEdges of type ``PrimaryTextNode``, ``TokenNode``,
            ``SpanNode`` and ``StructureNode``
        text : str
            the primary text of the Salt document
        tree : etree._ElementTree
            an ElementTree that represents a SaltXML document
        sentences : list of list of int
            a list of integers represents the ordered token node ids of
            the tokens in a sentence
        """
        self.doc_id = salt_document.doc_id
        self.edges = salt_document.edges
        self.layers = salt_document.layers
        self.nodes = salt_document.nodes
        self.text = salt_document.nodes[0].text
        self.tree = salt_document.tree

        # lists of node ids of a certain type
        self._token_node_ids = subtype_ids(self.nodes, TokenNode)
        self._span_node_ids = subtype_ids(self.nodes, SpanNode)
        self._structure_node_ids = subtype_ids(self.nodes, StructureNode)

        # lists of edge ids of a certain type
        self._textual_relation_ids = subtype_ids(self.edges, TextualRelation)
        self._spanning_relation_ids = subtype_ids(self.edges, SpanningRelation)
        self._dominance_relation_ids = subtype_ids(self.edges,
                                                   DominanceRelation)

        self._add_offsets_to_token_nodes()
        self.sentences = extract_sentences(self.nodes,
                                           self._token_node_ids)
        self._add_token_node_ids_to_span_nodes()
        self._add_span_node_ids_to_token_nodes()
        self._add_dominance_relation__to__nodes()
def __init__ ( self , salt_document ) : self . doc_id = salt_document . doc_id self . edges = salt_document . edges self . layers = salt_document . layers self . nodes = salt_document . nodes self . text = salt_document . nodes [ 0 ] . text self . tree = salt_document . tree self . _token_node_ids = subtype_ids ( self . nodes , TokenNode ) self . _span_node_ids = subtype_ids ( self . nodes , SpanNode ) self . _structure_node_ids = subtype_ids ( self . nodes , StructureNode ) self . _textual_relation_ids = subtype_ids ( self . edges , TextualRelation ) self . _spanning_relation_ids = subtype_ids ( self . edges , SpanningRelation ) self . _dominance_relation_ids = subtype_ids ( self . edges , DominanceRelation ) self . _add_offsets_to_token_nodes ( ) self . sentences = extract_sentences ( self . nodes , self . _token_node_ids ) self . _add_token_node_ids_to_span_nodes ( ) self . _add_span_node_ids_to_token_nodes ( ) self . _add_dominance_relation__to__nodes ( )
TODO: finish LinguisticDocument.__init__ docstring!
        additional, modified information:
          - adds string onsets/offsets to `TokenNode`s
          - adds the attribute 'self.sentences'
          - adds to each `SpanNode` the `TokenNode`s that belong to it
          - adds to each `TokenNode` the `SpanNode`s that it belongs to

        :param salt_document: SaltDocument

        Attributes
        ----------
        doc_id : str
            the document ID of the Salt document
        edges : list of SaltEdge
            i.e. SaltEdges of type ``TextualRelation``, ``SpanningRelation``
            and ``DominanceRelation``
        layers : list of SaltLayer
        nodes : list of SaltNode
            i.e. SaltEdges of type ``PrimaryTextNode``, ``TokenNode``,
            ``SpanNode`` and ``StructureNode``
        text : str
            the primary text of the Salt document
        tree : etree._ElementTree
            an ElementTree that represents a SaltXML document
        sentences : list of list of int
            a list of integers represents the ordered token node ids of
            the tokens in a sentence