medkit.text.postprocessing.attribute_duplicator
===============================================

.. py:module:: medkit.text.postprocessing.attribute_duplicator


Classes
-------

.. autoapisummary::

   medkit.text.postprocessing.attribute_duplicator.AttributeDuplicator


Module Contents
---------------

.. py:class:: AttributeDuplicator(attr_labels: list[str], uid: str | None = None)

   Bases: :py:obj:`medkit.core.Operation`


   
   Annotator to copy attributes from a source segment to its nested segments.

   For each attribute to be duplicated, a new attribute is created in the nested segment.

   :Parameters:

       **attr_labels** : list of str
           Labels of the attributes to copy

       **uid** : str, optional
           Identifier of the annotator














   ..
       !! processed by numpydoc !!

   .. py:method:: run(source_segments: list[medkit.core.text.Segment], target_segments: list[medkit.core.text.Segment])

      
      Add attributes from source segments to all nested segments.

      The nested segments are chosen among the `target_segments` based on their spans.

      :Parameters:

          **source_segments** : list of Segment
              List of segments with attributes to copy

          **target_segments** : list of Segment
              List of segments target














      ..
          !! processed by numpydoc !!


   .. py:method:: _duplicate_attr(attr: medkit.core.Attribute, target: medkit.core.text.Segment)


