ontocast.tool.chunk.segment¶
Mutable text segments during chunk preparation (before sizing).
PrepareSegment
dataclass
¶
One logical segment prior to min/max sizing.
Source code in ontocast/tool/chunk/segment.py
coalesce_small_segments_right(segments, min_chars, schema)
¶
Merge undersized segments into the right neighbor; otherwise into the left.
Source code in ontocast/tool/chunk/segment.py
is_abstract_exempt(segment, schema)
¶
Preserve short abstract segments instead of merging them into neighbors.
Source code in ontocast/tool/chunk/segment.py
segments_differ_in_structure(left, right, schema)
¶
True when merging would join distinct document sections.
Source code in ontocast/tool/chunk/segment.py
starts_with_section_heading(segment, schema)
¶
True when the segment opens with a recognised section heading line.