Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions src/types/interlinearizer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ declare module 'interlinearizer' {
* - A token may carry both a `TokenAnalysis` _and_ an approved `PhraseAnalysis`; the per-token
* parse coexists with the phrase-level gloss and is not a competing analysis.
*/
phrases: PhraseAnalysis[];
phraseAnalyses: PhraseAnalysis[];
}

/**
Expand Down Expand Up @@ -597,8 +597,8 @@ declare module 'interlinearizer' {
* whole-word morpheme. `pos` available from Macula TSV for source-language tokens only.
*/
export interface TokenAnalysis extends Analysis {
/** Reference to the `Token.ref` being analyzed. */
tokenRef: string;
/** Snapshot of the token being analyzed. */
token: TokenSnapshot;

/**
* Ordered morpheme breakdown. Present when the analysis reaches sub-word granularity (e.g. an
Expand All @@ -616,13 +616,6 @@ declare module 'interlinearizer' {
*/
features?: Record<string, string>;

/**
* Surface text of the token at analysis time — used for drift detection. Consumers compare this
* against the current `Token.surfaceText`; on mismatch, flip `status` to `'stale'` to prompt
* re-review.
*/
tokenSnapshot?: string;

/**
* Free-form gloss string keyed by BCP 47 analysis-language tag. Takes precedence over
* `glossSenseRef` when both are present.
Expand Down Expand Up @@ -710,7 +703,7 @@ declare module 'interlinearizer' {
/**
* A multi-token unit glossed or analyzed as a single phrase.
*
* `tokenRefs` lists the tokens (in order) that belong to the phrase. The tokens may be:
* `tokens` lists the tokens (in order) that belong to the phrase. The tokens may be:
*
* - Adjacent within one segment ("en el" → "in the")
* - Disjoint within one segment (French "ne … pas" → "not")
Expand Down Expand Up @@ -739,8 +732,8 @@ declare module 'interlinearizer' {
* share the same gloss / sense.
*/
export interface PhraseAnalysis extends Analysis {
/** Ordered `Token.ref` values of the tokens that compose this phrase. */
tokenRefs: [string, ...string[]];
/** Ordered snapshots of tokens that compose this phrase. */
tokens: [TokenSnapshot, ...TokenSnapshot[]];

/**
* Free-form gloss string keyed by BCP 47 analysis-language tag. Takes precedence over
Expand Down Expand Up @@ -865,6 +858,7 @@ declare module 'interlinearizer' {
export interface MorphemeLink {
/** The `TokenAnalysis.id` that owns the referenced morpheme. */
tokenAnalysisId: string;

/** Specific `MorphemeAnalysis.id` within the identified `TokenAnalysis.morphemes`. */
morphemeId: string;
}
Expand Down