medkit.text.preprocessing.char_replacer
=======================================

.. py:module:: medkit.text.preprocessing.char_replacer


Classes
-------

.. autoapisummary::

   medkit.text.preprocessing.char_replacer.CharReplacer


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

.. py:class:: CharReplacer(output_label: str, rules: list[tuple[str, str]] | None = None, name: str | None = None, uid: str | None = None)

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


   
   Generic character replacer to be used as pre-processing module.

   This module is a non-destructive module allowing to replace selected 1-char string
   with the wanted n-chars strings.
   It respects the span modification by creating a new text-bound annotation containing
   the span modification information from input text.

   :Parameters:

       **output_label** : str
           The output label of the created annotations

       **rules** : list of tuple, optional
           The list of replacement rules. Default: ALL_CHAR_RULES

       **name** : str, optional
           Name describing the pre-processing module (defaults to the class name)

       **uid** : str, optional
           Identifier of the pre-processing module














   ..
       !! processed by numpydoc !!

   .. py:attribute:: output_label


   .. py:attribute:: rules


   .. py:method:: run(segments: list[medkit.core.text.Segment]) -> list[medkit.core.text.Segment]

      
      Run the module on a list of segments provided as input and returns a new list of segments.


      :Parameters:

          **segments** : list of Segment
              List of segments to process



      :Returns:

          list of Segment
              List of new segments











      ..
          !! processed by numpydoc !!


   .. py:method:: _process_segment_text(segment: medkit.core.text.Segment)


