chunkipy.text_chunker.data_models
Classes
|
Represents a single chunk of text, which consists of multiple text parts. |
|
A list-like collection of chunks with utility methods for aggregation. |
A deque-like collection of TextParts with utility methods for aggregation. |
|
|
Represents a fragment or segment of a complete text, along with its character size. |
- class chunkipy.text_chunker.data_models.Chunk(text_parts=<factory>)[source]
Bases:
objectRepresents a single chunk of text, which consists of multiple text parts.
Computed Properties: :param text: Represents the full text of the chunk by joining all ‘text’ values from its ‘text parts. :param text:parts: A list of TextPart objects that make up the chunk.
- property size: int
Calculates and returns the total size of all TextPart objects within text_parts.
Returns: int: The total size of all TextPart objects.
- class chunkipy.text_chunker.data_models.Chunks(iterable=(), /)[source]
Bases:
listA list-like collection of chunks with utility methods for aggregation.
Inherits from ‘list’ to act as a standard list, while providing additional methods for aggregated operations.