Files
attendi/Packages/Features/Sources/Recording/Models/Transcription.swift
T

37 lines
889 B
Swift
Raw Normal View History

import Foundation
/// A transcription of a processed recording.
public struct Transcription: Equatable, Identifiable, Sendable {
// MARK: Properties
/// The unique identifier of the transcription.
public let id: UUID
/// The transcribed text of the processed recording.
public let text: String
// MARK: Initializers
/// Creates a transcription with a given text.
///
/// - Parameters:
/// - id: The unique identifier of the transcription. Defaults to a newly generated identifier.
/// - text: The transcribed text of the processed recording.
public init(
id: UUID = .init(),
text: String
) {
self.id = id
self.text = text
}
// MARK: Computed
/// A Boolean value that indicates whether the transcription has no text.
public var isEmpty: Bool {
text.isEmpty
}
}