Skip to content

Add the PT9 interlinear converter - #240

Draft
jasonleenaylor wants to merge 1 commit into
mainfrom
pt9-import-sync
Draft

Add the PT9 interlinear converter#240
jasonleenaylor wants to merge 1 commit into
mainfrom
pt9-import-sync

Conversation

@jasonleenaylor

@jasonleenaylor jasonleenaylor commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Convert the parsed PT9 file set into the extension's analysis layer, the second
slice of the PT9 import pipeline. convertPt9Project is a pure function of the
parsed files, the source project's text, and a timestamp — nothing here calls
papi.

  • clusterAnchoring matches each PT9 cluster to a word token by comparing
    spellings in order, because PT9's stored offsets point into a different
    string than our text.
  • languageAnalysisBuilder turns one gloss language's clusters into per-token
    and phrase records, marking approved only what PT9 approved.
  • analysisMerger combines records for the same token across gloss languages
    into one, keeping genuine disagreements as separate competing records.
  • pt9GlossSource looks up a lexeme's gloss text in Lexicon.xml.
  • glossLanguageTags turns a PT9 gloss-language value into a language tag we can
    key glosses by.
  • lexiconResolver is the seam for linking imported lexemes to the Lexicon
    extension; the stub it ships with links nothing yet.
  • bareWordAnalyses converts PT9's wordform lists into analyses that describe a
    spelling rather than any one occurrence, so they carry no links.
  • report counts what converted, and what was dropped and why.

index.ts is the converter's public surface: convertPt9Project, its input and
output types, the resolver seam, and the report types. The types each stage
hands the next stay internal to the conversion.

Dropped clusters are counted by reason rather than lost silently, so the report
shows whether a more precise anchoring strategy is worth building. Record ids
derive from the token reference and spelling, so re-importing the same data
produces the same ids. Persistence and the import command follow in the next
slice.

🤖 Generated with Claude Code


This change is Reviewable

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2aa9f9f5-e3a0-4bf7-8939-d05203b60e51

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jasonleenaylor
jasonleenaylor force-pushed the pt9-import branch 3 times, most recently from e86f828 to ef87486 Compare August 20, 2026 18:10
Base automatically changed from pt9-import to main August 20, 2026 20:08
Convert the parsed PT9 file set into the extension's analysis layer as the
second slice of the import pipeline: anchor clusters onto the tokenized text,
merge word and parse facets per token and contributions across gloss
languages, and report what converted alongside what was dropped and why.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant