medkit.text.postprocessing.alignment_utils

medkit.text.postprocessing.alignment_utils#

Functions#

compute_nested_segments(...)

Return source segments aligned with its nested segments.

Module Contents#

medkit.text.postprocessing.alignment_utils.compute_nested_segments(source_segments: list[medkit.core.text.Segment], target_segments: list[medkit.core.text.Segment]) list[tuple[medkit.core.text.Segment, list[medkit.core.text.Segment]]]#

Return source segments aligned with its nested segments.

Only nested segments fully contained in the source_segments are returned.

Parameters:
source_segmentslist of Segment

List of source segments

target_segmentslist of Segment

List of segments to align

Returns:
list of tuple

List of aligned segments