import SprachmittlerText /// The per-request chunk size and the total size one capture may have. /// /// `maximumParts == 1` rejects anything longer than one chunk. Higher values accept up to /// `maximumParts` chunks and translate them sequentially (`docs/TRANSLATION_OUTPUT.md` ยง3). public struct CaptureLimits: Sendable, Equatable { /// The per-request chunk size. public let chunker: Chunker /// How many chunks one capture may contain (at least 1). public let maximumParts: Int /// Creates limits. public init(chunker: Chunker = Chunker(), maximumParts: Int = 1) { self.chunker = chunker self.maximumParts = max(1, maximumParts) } /// The per-chunk character limit for `text`. public func chunkLimit(for text: String) -> Int { chunker.limit(for: text) } /// The total character limit for one capture. public func captureLimit(for text: String) -> Int { chunkLimit(for: text) * maximumParts } }