Lexicon.Concept and Lexicon.WordConcept: language-neutral pivots #15

Open
opened 2026-09-26 13:58:32 +00:00 by belvedere · 0 comments
Collaborator

Objective: Represent meaning independently of language so any source/target pair works
without an N×N matrix of language-pair tables.

Files:

  • Create: lib/first_thousand_words/lexicon/concept.ex
  • Create: lib/first_thousand_words/lexicon/word_concept.ex

Steps:

  1. Concept: gloss (short English gloss), pos_hint, rank (its order in the canonical
    1000-word syllabus). Identity on gloss + pos_hint for import idempotency.
  2. WordConcept: belongs_to :concept, belongs_to :word, plus sense_rank and
    confidence (:high | :medium | :low) to record how good a link is.
  3. Unique on (concept_id, word_id).

Why this shape: a concept can have several words per language (synonyms) and a word can carry
several concepts (polysemy). Modelled as a join, both are representable; modelled as
Word.translation columns, neither is.

Verify: build a trivial fixture linking EN water and ES agua to concept "water" and read
it back through the concept.

Refs: plan §3 (Domain model)

**Objective:** Represent meaning independently of language so any source/target pair works without an N×N matrix of language-pair tables. **Files:** - Create: `lib/first_thousand_words/lexicon/concept.ex` - Create: `lib/first_thousand_words/lexicon/word_concept.ex` **Steps:** 1. `Concept`: `gloss` (short English gloss), `pos_hint`, `rank` (its order in the canonical 1000-word syllabus). Identity on `gloss` + `pos_hint` for import idempotency. 2. `WordConcept`: `belongs_to :concept`, `belongs_to :word`, plus `sense_rank` and `confidence` (`:high | :medium | :low`) to record how good a link is. 3. Unique on `(concept_id, word_id)`. **Why this shape:** a concept can have several words per language (synonyms) and a word can carry several concepts (polysemy). Modelled as a join, both are representable; modelled as `Word.translation` columns, neither is. **Verify:** build a trivial fixture linking EN `water` and ES `agua` to concept "water" and read it back through the concept. **Refs:** plan §3 (Domain model)
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nickkeers/first-thousand-words#15
No description provided.