Projects BibleWeb Interlinear Multiple gloss options per word
Done

Multiple gloss options per word

Area: Interlinear Milestone: v2

Context

Problem: A single English gloss for a Greek/Hebrew word is reductive. The Greek "logos" can mean word, reason, speech, message, or account. Users need to see the full semantic range.

Solution: When expanding a word card in the interlinear popup, users see all available translation options — from Strong's meanings, KJV usage patterns, and BSB glosses — displayed as selectable chips.

Not included: User-defined custom glosses. Options come from the lexicon data.

Functional

User flow:

  1. Click a word card → expands
  2. See three sources of alternatives:
    • Meaning chips (up to 12 for Greek, 8 for Hebrew) — parsed from kjv_usage or definition
    • "Translated as" list (Greek only) — live-fetched frequency-sorted BSB/SV gloss variants with example verses
  3. Click a meaning chip → selects it as preferred gloss (see Per-Word Gloss Selection)

Edge cases:

  • "Translated as" drill-down is Greek-only — API rejects Hebrew Strong's numbers
  • Dutch mode: meaningsNl chips from strongs_greek.meanings_nl (JSON array) or parsed from definition_nl
  • Some words have very few alternatives; others have 10+

UX & Design

Expanded card sections:

  1. Full Strong's definition text
  2. "Also: ..." synonyms line
  3. Selectable meaning chips (teal accent)
  4. "Translated as" frequency list with count badges and clickable example verses

Technical

Meaning sources:

  • Greek: extractGreekMeanings(kjv_usage) in text.ts — parses up to 12 alternatives
  • Hebrew: extractHebrewMeanings(definition) — parses up to 8 from ;-separated definition
  • Dutch: meanings_nl JSON array from strongs_greek (may be empty, falls back to parsing definition_nl)

"Translated as" API: GET /api/interlinear/translations/{strongsNumber}?lang=en|nl

  • Groups greek_words by bsb_gloss (en) or sv_gloss (nl) for that Strong's number
  • Returns up to 10 variants sorted by frequency, each with example verse

Files:

  • apps/web/src/lib/components/bible/InterlinearPopup.svelte — expand/collapse + chip selection
  • apps/web/src/routes/api/interlinear/translations/[strongsNumber]/+server.ts — frequency API
  • apps/web/src/lib/utils/text.ts — meaning extraction functions

Status

Current: DONE Milestone: v2 Priority: High — core of the interlinear study experience

Dependencies:

  • Requires: Greek/Hebrew popups (DONE), Strong's data (DONE)
  • Enables: personal gloss selection (DONE)