medkit.text.preprocessing.regexp_replacer
=========================================

.. py:module:: medkit.text.preprocessing.regexp_replacer


Classes
-------

.. autoapisummary::

   medkit.text.preprocessing.regexp_replacer.RegexpReplacer


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

.. py:class:: RegexpReplacer(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 pattern replacer to be used as pre-processing module.

   This module is a non-destructive module allowing to replace a regex pattern
   by a new text.
   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 [(pattern_to_replace, new_text)]

       **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: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 normalize

      :Returns:

          list of Segment
              List of normalized segments













      ..
          !! processed by numpydoc !!


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


