How the words and phrases on a card's Similar/Opposite/Informal/Related-compound lists will be stored — confirm the shape before any build runs.
Each word or phrase on a card (a “target”) is stored once and shared by every sense that mentions it. What’s specific to one sense — its meaning in that context — lives on its own “item” row instead of being copied.
erDiagram
SENSE_CARD ||--o{ RELATION_ITEM : "owns"
RELATION_TARGET ||--o{ RELATION_ITEM : "is mentioned by"
RELATION_TARGET ||--o{ TARGET_GLOSS : "general meaning, one row per language"
RELATION_ITEM ||--o{ ITEM_GLOSS : "sense-specific meaning, one row per language"
RELATION_TARGET ||--o{ RELATION_EXAMPLE : "usage, Indonesian"
RELATION_EXAMPLE ||--o{ EXAMPLE_TEXT : "translation, one row per language"
RELATION_ITEM ||--o{ ITEM_NOTE : "context note, one row per language"
RELATION_TARGET }o..o| FULL_CARD : "link when a full card exists"
RELATION_TARGET }o..o| ENRICH_QUEUE_ROW : "one queue row per target"
LANGUAGE ||--o{ TARGET_GLOSS : "lang"
LANGUAGE ||--o{ ITEM_GLOSS : "lang"
LANGUAGE ||--o{ EXAMPLE_TEXT : "lang"
LANGUAGE ||--o{ ITEM_NOTE : "lang"
RELATION_TARGET {
uuid target_id PK
text l2_language FK
text text_norm "unique with l2_language"
text text_display
text kind "word | phrase — authored"
text register_intrinsic "nullable; slang etc. when true of the word itself"
text ipa
text respelling
text audio_normal_url
text audio_slow_url
uuid full_card_id FK "nullable"
text full_card_status "linked | none | queued | refused"
bigint enrich_queue_id FK "nullable"
jsonb provenance "model, version, authored_at — opaque, stored whole"
}
RELATION_ITEM {
uuid item_id PK
uuid source_card_id FK "the owning CT2 sense"
uuid target_id FK
text relation_kind "similar | opposite | informal | related_compound"
int ordinal
text register "formal | informal | slang | neutral — of the relationship"
bool is_idiom
text tag_raw "jenis as authored, kept for the record"
jsonb provenance
}
TARGET_GLOSS {
uuid target_id FK
text lang FK
text text
text state "machine | llm | human | locked"
}
ITEM_GLOSS {
uuid item_id FK
text lang FK
text text
text state
}
RELATION_EXAMPLE {
uuid example_id PK
uuid target_id FK
int ordinal
text l2_text
}
EXAMPLE_TEXT {
uuid example_id FK
text lang FK
text text
text state
}
ITEM_NOTE {
uuid item_id FK
text lang FK
text text
text state
}
Tapping the + on a word or phrase either adds it to the learner’s list right away (if a full card already exists) or queues it to be authored (if it doesn’t).
flowchart TD
TAP["Learner taps the standard add chip on an item"] --> Q{"target_status?"}
Q -- linked --> ADD["POST /api/learning-list/add with sense_id"]
ADD --> T310["t310 row, user_status = priority: next session"]
Q -- "no_card" --> ENQ["POST /api/learning-list/add with the item text"]
ENQ --> QUEUE["t_enrich_queue row: queue_type headword, status pending, requested_by = profile"]
QUEUE --> ITEM["item.target_status = queued"]
QUEUE --> DAEMON["enrichment daemon"]
DAEMON -- word --> CARD["catalog card created"]
DAEMON -- phrase --> PP{"phrase path: corpus phrase?"}
PP -- yes --> CARD
PP -- no --> REF["refused today: eight corpus-grounded steps refuse a non-corpus phrase (desk item G #334)"]
CARD --> LINK["item.target_card_id filled, status linked"]
LINK --> AUTO{"auto-add to the requester's list?"}
AUTO -- "built" --> T310
AUTO -- "not built today" --> PEND["learner sees pending; must tap again"]
Q -- queued --> WAIT["chip shows pending"]
Q -- refused --> HIDE["chip hidden or greyed"]
| Relation | Item text | Kind | Register | Is idiom | Eng gloss | Ind paraphrase | Target status |
|---|---|---|---|---|---|---|---|
| informal | mam | to be authored | to be authored | to be authored | baby talk for 'eat' used with small children at home | to be authored | None |
| informal | mamam | to be authored | to be authored | to be authored | cute child language for 'eat', common when coaxing toddlers | to be authored | None |
| informal | mkn | to be authored | to be authored | to be authored | texting shorthand for 'makan' in chats | to be authored | None |
| opposite | berpuasa | to be authored | to be authored | No | to fast (abstain from eating) | to be authored | None |
| opposite | menahan lapar | to be authored | to be authored | No | to hold back hunger (not eat) | to be authored | None |
| related compound | kasih makan | to be authored | to be authored | to be authored | to give food to a person or animal | memberi makan pada orang atau hewan | None |
| related compound | kereta makan | to be authored | to be authored | to be authored | dining car | gerbong kereta api yang dipakai sebagai tempat makan; restorasi | None |
| related compound | makan malam | to be authored | to be authored | to be authored | to have dinner | makan pada malam hari | None |
| related compound | makan pagi | to be authored | to be authored | to be authored | to have breakfast | makan pada waktu pagi; menyarap | None |
| related compound | makan siang | to be authored | to be authored | to be authored | to have lunch | makan pada waktu siang hari | None |
| related compound | makan sirih | to be authored | to be authored | to be authored | the habit of chewing betel leaf | kebiasaan mengunyah daun sirih | None |
| related compound | mencari makan | to be authored | to be authored | to be authored | to earn a living | mencari nafkah | None |
| related compound | nafsu makan | to be authored | to be authored | to be authored | the feeling of wanting to eat | rasa ingin makan | None |
| related compound | rumah makan | to be authored | to be authored | to be authored | restaurant | kedai tempat makan (menjual makanan) | None |
| related compound | sudah makan? | to be authored | to be authored | to be authored | a friendly greeting asking if you have eaten | sapaan akrab untuk tanya sudah makan | None |
| similar | bersantap | to be authored | to be authored | No | to dine | to be authored | None |
| similar | melahap | to be authored | to be authored | No | to devour | to be authored | None |
| similar | menikmati makanan | to be authored | to be authored | No | to enjoy a meal | to be authored | None |
| similar | menyantap | to be authored | to be authored | No | to partake (eat formally) | to be authored | None |
| Relation | Item text | Kind | Register | Is idiom | Eng gloss | Ind paraphrase | Target status |
|---|---|---|---|---|---|---|---|
| informal | makan waktu | to be authored | to be authored | to be authored | casual speech without prefix me-, same meaning as memakan waktu | to be authored | None |
| opposite | menghemat biaya | to be authored | to be authored | No | to save costs | to be authored | None |
| opposite | menghemat waktu | to be authored | to be authored | No | to save time | to be authored | None |
| similar | memakai | to be authored | to be authored | No | to use | to be authored | None |
| similar | memerlukan | to be authored | to be authored | No | to require | to be authored | None |
| similar | menghabiskan | to be authored | to be authored | No | to use up | to be authored | None |
| similar | menguras tenaga | to be authored | to be authored | No | to drain energy | to be authored | None |
| similar | menyita waktu | to be authored | to be authored | No | to take up time | to be authored | None |
| Relation | Item text | Kind | Register | Is idiom | Eng gloss | Ind paraphrase | Target status |
|---|---|---|---|---|---|---|---|
| informal | gak makan | to be authored | to be authored | to be authored | colloquial for 'rem tidak makan' in chat and speech | to be authored | None |
| opposite | macet | to be authored | to be authored | No | to jam, to get stuck | to be authored | Linked |
| opposite | rem blong | to be authored | to be authored | No | brakes fail | to be authored | None |
| opposite | tidak berfungsi | to be authored | to be authored | No | to not function | to be authored | None |
| similar | bekerja sebagaimana mestinya | to be authored | to be authored | No | to work as it should | to be authored | None |
| similar | berfungsi | to be authored | to be authored | No | to function | to be authored | None |
| similar | berjalan | to be authored | to be authored | No | to run properly | to be authored | Linked |
| similar | bisa | to be authored | to be authored | No | to work, can function | to be authored | Linked |
| Relation | Item text | Kind | Register | Is idiom | Eng gloss | Ind paraphrase | Target status |
|---|---|---|---|---|---|---|---|
| similar | ambil bidak | to be authored | to be authored | No | to take a piece | to be authored | None |
| similar | ganyang bidak | to be authored | to be authored | No | to wipe out a piece | to be authored | None |
| similar | gasak bidak | to be authored | to be authored | No | to snatch a piece | to be authored | None |
| similar | serang bidak | to be authored | to be authored | No | to attack a piece | to be authored | None |
| Relation | Item text | Kind | Register | Is idiom | Eng gloss | Ind paraphrase | Target status |
|---|---|---|---|---|---|---|---|
| informal | makan | to be authored | to be authored | to be authored | casual speech dropping meN- prefix, as in rust already ate through the iron | to be authored | Linked |
| opposite | melindungi | to be authored | to be authored | No | to protect | to be authored | None |
| opposite | memperbaiki | to be authored | to be authored | No | to repair | to be authored | None |
| similar | melukai | to be authored | to be authored | No | to injure | to be authored | None |
| similar | menembus | to be authored | to be authored | No | to penetrate | to be authored | None |
| similar | menggerogoti | to be authored | to be authored | No | to gnaw away at | to be authored | None |
| similar | mengikis | to be authored | to be authored | No | to erode | to be authored | None |
| similar | merusak | to be authored | to be authored | No | to damage | to be authored | None |
| Relation | Item text | Kind | Register | Is idiom | Eng gloss | Ind paraphrase | Target status |
|---|---|---|---|---|---|---|---|
| informal | korup | to be authored | to be authored | to be authored | short for korupsi, used in casual chat and news headlines | to be authored | None |
| opposite | mengembalikan dana | to be authored | to be authored | No | to return funds to their rightful place | to be authored | None |
| opposite | menjaga uang kas dengan jujur | to be authored | to be authored | No | to guard cash funds honestly | to be authored | None |
| similar | korupsi | to be authored | to be authored | No | to engage in corruption | to be authored | Linked |
| similar | menggelapkan uang | to be authored | to be authored | No | to misappropriate money | to be authored | None |
| similar | menyelewengkan dana | to be authored | to be authored | No | to misappropriate funds | to be authored | None |
| similar | rasuah | to be authored | to be authored | No | corruption by bribery | to be authored | None |
| Text | Kind | Phonetics | Example 1 | Example 2 | Full card |
|---|---|---|---|---|---|
| ambil bidak | to be authored | to be authored | to be authored | to be authored | None |
| bekerja sebagaimana mestinya | to be authored | to be authored | to be authored | to be authored | None |
| berfungsi | to be authored | to be authored | to be authored | to be authored | None |
| berjalan | to be authored | /bər.ˈdʒa.lan/ · buhr-JAH-lahn | Saya berjalan pagi ini. I walked this morning. | Kemarin kami berjalan ke pasar. Yesterday we walked to the market. | Open card › |
| berpuasa | to be authored | to be authored | to be authored | to be authored | None |
| bersantap | to be authored | to be authored | to be authored | to be authored | None |
| bisa | to be authored | /ˈbi.sa/ · BEE-sah | Saya bisa membaca. I can read. | Kamu bisa berenang? Can you swim? | Open card › |
| gak makan | to be authored | to be authored | to be authored | to be authored | None |
| ganyang bidak | to be authored | to be authored | to be authored | to be authored | None |
| gasak bidak | to be authored | to be authored | to be authored | to be authored | None |
| kasih makan | to be authored | to be authored | to be authored | to be authored | None |
| kereta makan | to be authored | to be authored | to be authored | to be authored | None |
| korup | to be authored | to be authored | to be authored | to be authored | None |
| korupsi | to be authored | /ko.ˈrup.si/ · koh-ROOP-see | Korupsi itu ambil uang negara. Corruption is taking the country's money. | Dia sudah lawan korupsi baru itu. He fought that new corruption. | Open card › |
| macet | to be authored | /ˈma.tʃət/ · MAH-chuht | Jalan ke pasar sangat macet pagi ini. The road to the market is very jammed this morning. | Saya beli bumbu kemarin di pasar, lalu saluran air di dapur macet. I bought spices at the market yesterday, then the kitchen drain got blocked. | Open card › |
| makan | to be authored | /ˈma.kan/ · MAH-kahn | Saya makan nasi dan ikan. I eat rice and fish. | Kami sedang makan di dapur. We are eating in the kitchen. | Open card › |
| makan malam | to be authored | to be authored | to be authored | to be authored | None |
| makan pagi | to be authored | to be authored | to be authored | to be authored | None |
| makan siang | to be authored | to be authored | to be authored | to be authored | None |
| makan sirih | to be authored | to be authored | to be authored | to be authored | None |
| makan waktu | to be authored | to be authored | to be authored | to be authored | None |
| mam | to be authored | to be authored | to be authored | to be authored | None |
| mamam | to be authored | to be authored | to be authored | to be authored | None |
| melahap | to be authored | to be authored | to be authored | to be authored | None |
| melindungi | to be authored | to be authored | to be authored | to be authored | None |
| melukai | to be authored | to be authored | to be authored | to be authored | None |
| memakai | to be authored | to be authored | to be authored | to be authored | None |
| memerlukan | to be authored | to be authored | to be authored | to be authored | None |
| memperbaiki | to be authored | to be authored | to be authored | to be authored | None |
| menahan lapar | to be authored | to be authored | to be authored | to be authored | None |
| mencari makan | to be authored | to be authored | to be authored | to be authored | None |
| menembus | to be authored | to be authored | to be authored | to be authored | None |
| mengembalikan dana | to be authored | to be authored | to be authored | to be authored | None |
| menggelapkan uang | to be authored | to be authored | to be authored | to be authored | None |
| menggerogoti | to be authored | to be authored | to be authored | to be authored | None |
| menghabiskan | to be authored | to be authored | to be authored | to be authored | None |
| menghemat biaya | to be authored | to be authored | to be authored | to be authored | None |
| menghemat waktu | to be authored | to be authored | to be authored | to be authored | None |
| mengikis | to be authored | to be authored | to be authored | to be authored | None |
| menguras tenaga | to be authored | to be authored | to be authored | to be authored | None |
| menikmati makanan | to be authored | to be authored | to be authored | to be authored | None |
| menjaga uang kas dengan jujur | to be authored | to be authored | to be authored | to be authored | None |
| menyantap | to be authored | to be authored | to be authored | to be authored | None |
| menyelewengkan dana | to be authored | to be authored | to be authored | to be authored | None |
| menyita waktu | to be authored | to be authored | to be authored | to be authored | None |
| merusak | to be authored | to be authored | to be authored | to be authored | None |
| mkn | to be authored | to be authored | to be authored | to be authored | None |
| nafsu makan | to be authored | to be authored | to be authored | to be authored | None |
| rasuah | to be authored | to be authored | to be authored | to be authored | None |
| rem blong | to be authored | to be authored | to be authored | to be authored | None |
| rumah makan | to be authored | to be authored | to be authored | to be authored | None |
| serang bidak | to be authored | to be authored | to be authored | to be authored | None |
| sudah makan? | to be authored | to be authored | to be authored | to be authored | None |
| tidak berfungsi | to be authored | to be authored | to be authored | to be authored | None |
Item table: 47 of 216 cells exist today. Target table: 15 of 216 cells exist today. Combined: 62 of 432 cells exist today — the rest are “to be authored”.
| Unit | Count | Per unit | Driver |
|---|---|---|---|
| targets | 28,474 | one model call (kind, phonetics, example) | model price per call |
| items | 48,844 | one model call per language beyond eng (gloss) | × languages |
| examples | 28,474 | one translation call per language | × languages |
| notes | 1,111 | one translation call per missing language | small |
| translation rows written | ≈ 214,000 at 2 languages (eng + ind) | — | rows, not money |
| sound | 28,474 clip pairs | 🟡 the expensive line: docket 65 measured ≈1.8 credits per clip, so ≈ 100,000 credits for both speeds | ElevenLabs plan |
Before any of that runs at full scale, the plan is to prove it on 50 words first: migrate their items, write their meanings, translate them, link them to full cards where one exists, and measure the real dollar and credit cost per word — then show Frank the finished card and the real numbers before anything bigger runs.