medkit.core.text.span
medkit.core.text.span#
Classes:
|
Slice of text not present in the original text |
|
Slice of text extracted from the original text |
- class Span(start, end)[source]#
Slice of text extracted from the original text
- Parameters
start (int) – Index of the first character in the original text
end (int) – Index of the last character in the original text, plus one
Methods:
from_dict(span_dict)Creates a Span from a dict
overlaps(other)Test if 2 spans reference at least one character in common
- class ModifiedSpan(length, replaced_spans)[source]#
Slice of text not present in the original text
- Parameters
length (int) – Number of characters
replaced_spans (List[medkit.core.text.span.Span]) – Slices of the original text that this span is replacing
Methods:
from_dict(modified_span_dict)Creates a Modified from a dict