| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import Foundation
- enum TitleOptimizerTab: String, CaseIterable, Identifiable {
- case optimize
- case compare
- case preview
- var id: String { rawValue }
- var title: String {
- switch self {
- case .optimize: "Optimize"
- case .compare: "Compare"
- case .preview: "Preview"
- }
- }
- }
- enum TitleGoal: String, CaseIterable, Identifiable {
- case curiosity
- case question
- case listicle
- case emotional
- case direct
- case provocative
- var id: String { rawValue }
- var title: String {
- switch self {
- case .curiosity: "Curiosity"
- case .question: "Question"
- case .listicle: "Listicle"
- case .emotional: "Emotional"
- case .direct: "Direct"
- case .provocative: "Bold"
- }
- }
- var subtitle: String {
- switch self {
- case .curiosity: "Create intrigue"
- case .question: "Ask the community"
- case .listicle: "Numbers & lists"
- case .emotional: "Personal & relatable"
- case .direct: "Clear & concise"
- case .provocative: "Spark debate"
- }
- }
- }
- enum TitleVariantCount: Int, CaseIterable, Identifiable {
- case three = 3
- case five = 5
- case eight = 8
- var id: Int { rawValue }
- var label: String { "\(rawValue) titles" }
- }
- struct TitleDraft: Equatable {
- var subreddit: String = ""
- var topic: String = ""
- var tone: PostTone = .casual
- var titleGoal: TitleGoal = .curiosity
- var originalTitle: String = ""
- var postType: RedditPostType = .text
- var isNSFW: Bool = false
- var isSpoiler: Bool = false
- var isOC: Bool = false
- var flair: String = ""
- var variantCount: TitleVariantCount = .five
- }
- struct TitleVariant: Identifiable, Equatable {
- let id: UUID
- var title: String
- var score: Int
- var reasoning: String
- init(id: UUID = UUID(), title: String, score: Int, reasoning: String) {
- self.id = id
- self.title = title
- self.score = score
- self.reasoning = reasoning
- }
- }
- struct TitleAnalysis: Equatable {
- var overallScore: Int
- var lengthScore: Int
- var engagementScore: Int
- var clarityScore: Int
- var suggestions: [String]
- }
- struct TitleOptimizationResult: Equatable {
- var analysis: TitleAnalysis
- var variants: [TitleVariant]
- }
|