sillsdev / sillsdev/interlinearizer-extension

Analysis Catalog: morpheme rows

Open
#189 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2
Forks
0
Avg merge
1d 17h
Merged PRs (30d)
55

Description

Add a morpheme list to the Analysis Catalog (#186), so morphemes can be counted, sorted, and edited independently of the words that contain them.

What is already reachable without this

Morpheme data is not invisible in the token-only catalog: morphemes render as detail inside a token row, and token search matches morpheme forms and glosses. Typing DAT.SG already finds the words that use it.

What is missing is everything that needs a morpheme to be its own row:

  • independent counts and sorting ("how many times have I used DAT.SG across all words?")
  • filtering to bare-form morphemes — split out but never glossed, which is real unfinished-work triage
  • a global morpheme gloss edit that fixes every containing analysis at once

Why this is the hardest of the three lists

MorphemeAnalysis is not a payload. It is a nested array inside TokenAnalysis.morphemes, with an id unique only within that array, no link table, and no dedupe. So:

  • Identity has to be derived. Group by the projection that already exists — morphemeIdentity in analysis-identity.ts (form + gloss + entryRef / senseRef / allomorphRef / grammarRef). This makes the catalog its second consumer; keep the two in step.
  • Usage locations are a union. A morpheme row's locations are the locations of every containing token analysis.
  • Editing fans out and can cascade. Writing a morpheme gloss into M containing TokenAnalysis payloads can make several of them content-identical to other analyses, firing mergeIntoIdenticalPayload. Editing one morpheme row can silently collapse several token rows into each other. That has to be surfaced, not silently applied.

Delete semantics: clears the analysis, keeps the parse

Deleting a morpheme row removes the analysis, not the morpheme. The M morphemes lose their gloss and lexicon refs; form and position stay. The row -ῇ -> DAT.SG (40) disappears and -ῇ -> (unglossed) (40) appears. Every parse stays intact.

Rejected: removing the morpheme from each parse. That leaves M breakdowns that no longer decompose their word, and it fires the cascade above as a second surprise from one click. Re-cutting a word is what the morpheme editor on the token chip is for, where the whole word is visible.

This keeps delete meaning one thing everywhere: it removes recorded analysis, never the shape of the text or its decomposition.

Note on breakdown editing

Editing how a word is cut stays on the token row, not here — that is a property of the token analysis, and one edit there already fixes every usage. A morpheme row edits a morpheme's gloss and refs. Two different questions about two different objects, which is why they are separate lists.

Follow-up to #186.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with analysis-identity.ts and the existing Analysis Catalog work from #186, then trace how TokenAnalysis.morphemes and mergeIntoIdenticalPayload are handled. Define the morpheme-row identity and usage union, and ensure independent counts, sorting, filtering, gloss/ref editing, and analysis-only deletion are represented. Done includes surfacing cascades when edits merge token analyses.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.