You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Umbrella for the goal raised in #94: fully support importing PT9 interlinearizations into an InterlinearProject. The XML parser exists but is wired into nothing — this issue is the end-to-end pipeline from PT9 data to a working, editable project.
Companions: #148 (model-text suggestion source, incl. the major-language model PT9 glosses against) and #149 (output project). This issue consumes both — it discovers a PT9 project's model/output relationships and attaches them to the imported project.
Generalize the interlinearizer — an imported PT9 project behaves like any other: its source, model, and output can be changed or dropped afterward.
First-contact discoverable — import is offered where a user would look for it (e.g. from the project picker / "open" flow), not as a required up-front decision.
Not wired into anything — no import command, no cluster→analysis mapping, no gloss-text resolution, no UI. grep confirms the parser and its types are referenced only by their own tests.
Scope — the pipeline
Import command + UI. An interlinearizer.importPt9 command and an entry point (file/folder picker for Interlinear_<lang>_<book>.xml, or selection of a PT9 project). Creates an InterlinearProject via projectStorage / interlinearizer.createProject.
Cluster → Token mapping (the crux). PT9 Cluster.Range is an Index/Length span in the verse text; our tokens carry charStart/charEnd within Segment.baselineText from bookTokenizer. Reconcile the two so each cluster resolves to the token(s) it covers. A single-lexeme cluster over one token → a TokenAnalysis; a cluster spanning multiple tokens → a PhraseAnalysis; a multi-lexeme cluster → a morpheme breakdown (TokenAnalysis.morphemes).
Gloss-text resolution (the big unknown). The XML stores only Lexeme.Id + GlossId/SenseId — not gloss text. Resolving to a displayable gloss needs a lexicon. Options: resolve to TokenAnalysis.glossSenseRef (a SenseRef into the Lexicon extension, resolved lazily — the model already supports this) and/or resolve to literal gloss text at import time from PT9's lexicon files. Decide the strategy (see Open questions).
Punctuation / Excluded / Hash. Punctuation tokens come from the tokenizer already; PT9 Punctuation change records are likely informational. Excluded clusters map to a suppressed/location-specific state. Verse Hash present ⇒ approved: map to status: 'approved' (+ confidence), absent ⇒ suggested.
Multi-file merge. One file per book per gloss language (Interlinear_<lang>_<book>.xml). Merge across books and languages into one project whose analysisLanguages union the GlossLanguages.
Exporting back to PT9 XML (separate, if ever needed).
Open questions
Gloss resolution: import to glossSenseRef (lazy Lexicon resolution) vs. literal gloss text (from PT9 lexicon files) vs. both? What is the source of gloss text when the Lexicon extension lacks the entry?
Where PT9 data comes from: a mounted PT9 project directory, individual XML files, or a PAPI-exposed PT9 project? This decides the import UI and how ScrTextName maps to a Platform.Bible sourceProjectId.
Should this go to user-questions.md for review outside the dev team? (per AGENTS.md UX-decisions guidance)
Size: L (multi-stage pipeline; the cluster↔token mapping and gloss resolution are each substantial). Priority: P1 — this is the concrete goal ("fully support importing PT9 interlinearizations"); #148/#149 are its enabling pieces.
Umbrella for the goal raised in #94: fully support importing PT9 interlinearizations into an
InterlinearProject. The XML parser exists but is wired into nothing — this issue is the end-to-end pipeline from PT9 data to a working, editable project.Companions: #148 (model-text suggestion source, incl. the major-language model PT9 glosses against) and #149 (output project). This issue consumes both — it discovers a PT9 project's model/output relationships and attaches them to the imported project.
Design principles this follows
Current state
src/parsers/pt9/interlinearXmlParser.ts—InterlinearXmlParser.parse(xml)→InterlinearData(ScrTextName,GlossLanguage,BookId,Verses: verse key →VerseDataofClusters+Punctuations). Schema inpt9-xml.md; one sample intest-data/Interlinear_en_MAT.xml.grepconfirms the parser and its types are referenced only by their own tests.Scope — the pipeline
interlinearizer.importPt9command and an entry point (file/folder picker forInterlinear_<lang>_<book>.xml, or selection of a PT9 project). Creates anInterlinearProjectviaprojectStorage/interlinearizer.createProject.Cluster.Rangeis anIndex/Lengthspan in the verse text; our tokens carrycharStart/charEndwithinSegment.baselineTextfrombookTokenizer. Reconcile the two so each cluster resolves to the token(s) it covers. A single-lexeme cluster over one token → aTokenAnalysis; a cluster spanning multiple tokens → aPhraseAnalysis; a multi-lexeme cluster → a morpheme breakdown (TokenAnalysis.morphemes).Lexeme.Id+GlossId/SenseId— not gloss text. Resolving to a displayable gloss needs a lexicon. Options: resolve toTokenAnalysis.glossSenseRef(aSenseRefinto the Lexicon extension, resolved lazily — the model already supports this) and/or resolve to literalglosstext at import time from PT9's lexicon files. Decide the strategy (see Open questions).Excluded/Hash. Punctuation tokens come from the tokenizer already; PT9Punctuationchange records are likely informational.Excludedclusters map to a suppressed/location-specific state. VerseHashpresent ⇒ approved: map tostatus: 'approved'(+confidence), absent ⇒suggested."MAT 1:1") →Segment.id; cluster ranges → token offsets (step 2). Non-matching ranges (baseline drift) →stalehandling.Interlinear_<lang>_<book>.xml). Merge across books and languages into one project whoseanalysisLanguagesunion theGlossLanguages.Dependencies
EntryRef/SenseRefgaps documented ininterlinearizer.d.ts).bookTokenizer— the token grid clusters must map onto.Out of scope
Open questions
glossSenseRef(lazy Lexicon resolution) vs. literalglosstext (from PT9 lexicon files) vs. both? What is the source of gloss text when the Lexicon extension lacks the entry?ScrTextNamemaps to a Platform.BiblesourceProjectId.user-questions.mdfor review outside the dev team? (per AGENTS.md UX-decisions guidance)Size: L (multi-stage pipeline; the cluster↔token mapping and gloss resolution are each substantial).
Priority: P1 — this is the concrete goal ("fully support importing PT9 interlinearizations"); #148/#149 are its enabling pieces.