code: def __add_segment(self, segment):
          
          segment_id = self.ns+':'+segment.attrib['id']
          self.segments.append(segment_id)
          segment_type, parent_segment_type = self.__get_segment_types(segment)
          segment_text = sanitize_string(segment.text)
          segment_label = get_segment_label(
              segment, segment_type, segment_text, self.ns, self.tokenized)
  
          self.add_node(
              segment_id, layers={self.ns, self.ns+':segment'},
              attr_dict={'label': segment_label,
                         self.ns+':text' : segment_text,
                         self.ns+':segment_type': segment_type})
  
          # store RST segment in list of EDUs
          self.edus.append(segment_id)
  
          if 'parent' in segment.attrib:
              self.__add_parent_relation(segment, segment_id, segment_type,
                                         parent_segment_type)
docs: add attributes to segment nodes, as well as edges to/from other
          segments/groups. add segment to list of EDUs.
  
          Parameters
          ----------
          segment : ??? etree Element