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

Closed
opened 2026-09-26 13:58:57 +00:00 by belvedere · 1 comment
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)
Author
Collaborator

Duplicate of #15 — created by a re-run whose pagination helper only saw the first page of issues. Closing to keep the backlog clean. Repo owner can delete this outright.

Duplicate of #15 — created by a re-run whose pagination helper only saw the first page of issues. Closing to keep the backlog clean. Repo owner can delete this outright.
Sign in to join this conversation.
No project
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#67
No description provided.