Add a grammar curator over a structured lessons input #7

Merged
raisondetredev merged 1 commit from refs/pull/7/head into main 2026-06-05 09:30:04 +02:00
raisondetredev commented 2026-06-05 09:29:50 +02:00 (Migrated from codeberg.org)

Scaffolds the Grammar pillar (roadmap §6) the way the JMdict path works:
the curator owns the transform, the content lives in an external file
the user supplies. Each lesson becomes a rich-text note plus its derived
front/back flashcards — the "note-plus-derived-flashcards" pattern.

  • grammar_lessons.dart: the documented input format (JSON) + parser
    with validating FormatExceptions. A lessons file has a title /
    license / attribution and a list of lessons, each with a title, a
    body, optional tags, and derived {front, back} cards.
  • grammar_curator.dart: GrammarLessonSet → one studyset where every
    lesson lands as a note (its body) alongside its cards; a lesson's tags
    become studyset-scoped content tags attached to that lesson's cards.
  • halkyon_archive.dart: emit-side ArchiveNote + notes list, byte-
    compatible with halkyon-learn's reader (the import side landed in
    learn's "Carry notes in the Halkyon archive").
  • bin/grammar.dart: dart run halkyon_curator:grammar --input lessons.json --output grammar.halkyon [--title ...].
  • example/grammar_lessons.sample.json: a runnable two-lesson template
    (は particle, です copula) that documents the format and is asserted
    valid by the tests.

Body text is plain (paragraph-per-line) for now; richer markup is left
out of the format so it can be added without a breaking change. 12 tests
(parser validation + curator output + sample validity); analyzer clean;
CLI verified end-to-end (sample → 2 notes / 4 cards / 3 tags).

Signed-off-by: Tizian 「ティツィアーン」 raisondetredev@pm.me

Scaffolds the Grammar pillar (roadmap §6) the way the JMdict path works: the curator owns the transform, the content lives in an external file the user supplies. Each lesson becomes a rich-text note plus its derived front/back flashcards — the "note-plus-derived-flashcards" pattern. - `grammar_lessons.dart`: the documented input format (JSON) + parser with validating FormatExceptions. A lessons file has a title / license / attribution and a list of lessons, each with a title, a body, optional tags, and derived {front, back} cards. - `grammar_curator.dart`: `GrammarLessonSet` → one studyset where every lesson lands as a note (its body) alongside its cards; a lesson's tags become studyset-scoped `content` tags attached to that lesson's cards. - `halkyon_archive.dart`: emit-side `ArchiveNote` + `notes` list, byte- compatible with halkyon-learn's reader (the import side landed in learn's "Carry notes in the Halkyon archive"). - `bin/grammar.dart`: `dart run halkyon_curator:grammar --input lessons.json --output grammar.halkyon [--title ...]`. - `example/grammar_lessons.sample.json`: a runnable two-lesson template (は particle, です copula) that documents the format and is asserted valid by the tests. Body text is plain (paragraph-per-line) for now; richer markup is left out of the format so it can be added without a breaking change. 12 tests (parser validation + curator output + sample validity); analyzer clean; CLI verified end-to-end (sample → 2 notes / 4 cards / 3 tags). Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
project-halkyon/halkyon-curator!7
No description provided.