Fixes #28 — Curated reflexive verb list on detail + practice filter
Bundles the 100 most common reflexive verbs from spanishwithdaniel.com as a canonical list and wires it through the UI. Compound list entries (recibirse / graduarse, equivocarse / confundirse) are split. Trailing prepositions and set-phrase completions are captured as usageHint (e.g. acordarse "de", ponerse "de acuerdo"). ReflexiveVerbStore loads the JSON at launch and exposes lookups by base infinitive, both via @Environment for SwiftUI and a static shared instance for services. Verbs whose bare infinitive isn't in the list skip the UI treatment silently. VerbDetailView shows a new Reflexive section with the reflexive infinitive, usage hint, and English meaning when there is a match. VerbListView gains a "Reflexive verbs only" filter alongside the existing Level and Irregularity filters. Settings adds the same flag so it also constrains the practice pool; PracticeSessionService applies the reflexive filter in all six pick paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import Foundation
|
||||
|
||||
/// A single entry from the curated "100 most common reflexive verbs" list
|
||||
/// (Gitea issue #28). Sourced from spanishwithdaniel.com.
|
||||
///
|
||||
/// `baseInfinitive` is the stem without the reflexive "-se" suffix, used to
|
||||
/// match this entry to the app's Verb records (which store bare infinitives).
|
||||
/// `usageHint` captures trailing prepositions or set-phrase completions — e.g.,
|
||||
/// "a" for `acercarse a`, "de acuerdo" for `ponerse de acuerdo`. Nil when the
|
||||
/// reflexive form has no commonly paired preposition.
|
||||
public struct ReflexiveVerb: Codable, Hashable, Sendable {
|
||||
public let infinitive: String
|
||||
public let baseInfinitive: String
|
||||
public let english: String
|
||||
public let usageHint: String?
|
||||
|
||||
public init(infinitive: String, baseInfinitive: String, english: String, usageHint: String? = nil) {
|
||||
self.infinitive = infinitive
|
||||
self.baseInfinitive = baseInfinitive
|
||||
self.english = english
|
||||
self.usageHint = usageHint
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user