| name | cross-reference-entry |
| description | Guidelines for adding and maintaining cross-references between dictionary entries. Covers reference types, format requirements, and extraction from notes. |
Cross-Reference Entry Guidelines
When creating or revising entries, add cross-references to related vocabulary. This improves navigation and helps learners understand word relationships.
Two Cross-Reference Mechanisms
The dictionary has two structured cross-reference systems (plus inline word links, which are handled separately):
1. prominent_see_also โ Top-of-entry links (HIGH VISIBILITY)
Displayed immediately below the headword, before definitions. These are the first thing a learner sees after the headword. Use for word pairs and groups that are closely related and which learners are likely to want to navigate between.
When to use prominent_see_also:
- Homophones with different kanji โ learners may have landed on the wrong entry
- {่|ใ}ใ (hear) โ {่ด|ใ}ใ (listen attentively)
- {็ก|ใช}ใใชใ (disappear) โ {ไบก|ใช}ใใชใ (pass away)
- Transitive/intransitive verb pairs โ always use
prominent_see_also, NOT cross_references
- {้|ใ}ใพใ (intransitive) โ {้|ใ}ใใ (transitive)
- {ๅง|ใฏใ}ใพใ (intransitive) โ {ๅง|ใฏใ}ใใ (transitive)
- N/Nใใ pairs โ noun form and verb form of the same word
- {็บๆฎ|ใฏใฃใ} (noun) โ {็บๆฎ|ใฏใฃใ}ใใ (verb)
- {ๆจๆถ|ใใใใค} (noun) โ {ๆจๆถ|ใใใใค}ใใ (verb)
- Informal/formal pairs โ different register forms of the same concept
- ใใพใ (informal: tasty/skilled) โ {็พๅณ|ใใ}ใใ (standard: tasty)
- Other closely related pairs/groups โ words that learners are likely to want to learn together
- {ๅถไฝ|ใใใใ} (artistic creation) โ {่ฃฝไฝ|ใใใใ} (manufacturing)
- {ไบบๅฃ|ใใใใ} (population) โ {ไบบๅทฅ|ใใใใ} (artificial)
When NOT to use prominent_see_also:
- Regular synonyms (use
cross_references with type synonym)
- Words that happen to sound similar but aren't confusable in practice
- Words with different POS that a learner wouldn't confuse
- Words in very different registers or domains that wouldn't be confused in practice
Format:
"prominent_see_also": [
{
"target_id": "00754_shimaru",
"reading": "ใใพใ",
"headword": "{้|ใ}ใพใ",
"note": "intransitive"
}
]
- Always include
target_id when the target entry exists
- Always include a brief
note in English (2-4 words) explaining the relationship
- Add references bidirectionally โ both entries should point to each other
- For N/Nใใ pairs, use notes like "verb form" / "noun form"
- For transitive/intransitive pairs, use notes like "transitive" / "intransitive"
- For homophones, use a brief gloss distinguishing the words
2. cross_references โ "Related Words" box at the bottom (STRUCTURED)
A structured array displayed in a "Related Words" box at the bottom of the entry page. These express lexicographic relationships between entries. Two-way linking is encouraged but not as critical as for prominent_see_also.
Cross-Reference Types (for cross_references)
antonym โ Opposites (HIGH PRIORITY)
Use for direct opposites.
{
"type": "antonym",
"reading": "ใใใ",
"headword": "{้|ใ}ใใ",
"label": "to open"
}
Label: Brief gloss of target word
keigo โ Honorific/Humble Forms (HIGH PRIORITY)
Use for formal speech equivalents.
{
"type": "keigo",
"reading": "ใใใใใ",
"headword": "{ๅฌ|ใ}ใ{ไธ|ใ}ใใ",
"label": "honorific"
}
Labels: honorific or humble
Common keigo links:
- ้ฃในใ โ ๅฌใไธใใ (hon.), ใใใ ใ (hum.)
- ่กใ โ ใใใฃใใใ (hon.), ๅใ (hum.)
- ่จใ โ ใใฃใใใ (hon.), ็ณใ (hum.)
- ่ฆใ โ ใ่ฆงใซใชใ (hon.), ๆ่ฆใใ (hum.)
synonym โ Similar Meaning (MEDIUM PRIORITY)
Use for words with similar meaning but different nuance.
{
"type": "synonym",
"reading": "ใใใใใ",
"headword": "{็่งฃ|ใใใ}ใใ",
"label": "formal"
}
Label: Distinguishing characteristic (e.g., "formal", "written", "casual")
contrast โ Easily Confused (MEDIUM PRIORITY)
Use for words learners often confuse.
{
"type": "contrast",
"reading": "ใ",
"headword": "ใ",
"label": "subject marking"
}
Especially important for:
- Particles: ใฏ vs ใ, ใซ vs ใง, ใซ vs ใธ
- Similar verbs: ่ใ vs ่ดใ, ่ฆใ vs ่ฆใใ vs ่ฆใใ
homophone โ Same Reading, Different Meaning (MEDIUM PRIORITY)
Use for words that share a reading. Note: if the homophones are easily confused, prefer prominent_see_also instead.
related โ Semantically Connected (LOW PRIORITY)
Use for derived words, compounds, or thematically related vocabulary.
{
"type": "related",
"reading": "ใในใใฎ",
"headword": "{้ฃ|ใ}ใน{็ฉ|ใใฎ}",
"label": "food (noun)"
}
see_also โ General Reference (LOW PRIORITY)
Use for general cross-references that don't fit other categories.
{
"type": "see_also",
"reading": "ใใใใ",
"headword": "{้ฃไบ|ใใใใ}",
"label": null
}
pair โ DEPRECATED
Do not use. Transitive/intransitive verb pairs should use prominent_see_also instead. Existing pair-type entries in cross_references should be migrated to prominent_see_also when entries are revised. The type remains technically valid in the schema but should not appear in new entries.
Format Requirements
Each cross_references entry requires:
| Field | Required | Description |
|---|
type | Yes | One of: synonym, antonym, keigo, related, see_also, contrast, homophone (avoid pair) |
target_id | No | Hard-coded entry ID for direct resolution (takes priority over reading/headword) |
reading | Yes | Hiragana reading (fallback lookup key when no target_id) |
headword | Yes* | Display form with furigana (required for homonym disambiguation) |
label | No | Short descriptor |
*Headword is required for proper resolution. Without it, cross-references cannot be disambiguated between homonyms.
Each prominent_see_also entry requires:
| Field | Required | Description |
|---|
target_id | No | Hard-coded entry ID for direct resolution |
reading | Yes | Hiragana reading |
headword | Yes | Display form with furigana |
note | Yes | Brief English description of the relationship (2-4 words) |
Note: Valid cross-reference types are defined centrally in build/constants.py and shared across the schema, validation, and build scripts.
Hybrid Cross-Reference System
The dictionary uses a hybrid system that supports both:
- Hard-coded
target_id โ Direct reference to an entry ID (unambiguous)
- Forward references โ References by reading/headword to entries that may not exist yet
Resolution Priority
When resolving a cross-reference:
- If
target_id present AND entry exists โ resolved (use ID directly)
- If
target_id present AND entry missing โ ERROR (stale reference)
- If no
target_id โ resolve by reading/headword (may be pending if target doesn't exist)
When to Use target_id
Use target_id when:
- The target entry exists in the dictionary
- You want guaranteed, unambiguous resolution
Don't manually add target_id when:
- Creating forward references to entries that don't exist yet
- You're unsure which homonym is correct
Instead, use the harden_references.py script to automatically add target_id to resolvable references.
Example with target_id
{
"type": "antonym",
"target_id": "00754_shimaru",
"reading": "ใใพใ",
"headword": "{้|ใ}ใพใ",
"label": "intransitive"
}
Example forward reference (no target_id)
{
"type": "antonym",
"reading": "ใฒใใ",
"headword": "{้|ใฒใ}ใ",
"label": "to open"
}
Homonym Disambiguation
CRITICAL: Many Japanese words share the same reading but have different kanji (homonyms). The headword field is essential for correct resolution.
Example: The reading ใใใใใ has multiple entries:
- {ๆๆ
|ใใใใใ} โ emotion, feeling
- {ๅๅฎ|ใใใใใ} โ bill, calculation
Always include the headword to ensure cross-references link to the correct entry.
{
"type": "synonym",
"reading": "ใใใใใ",
"headword": "{ๅๅฎ|ใใใใใ}",
"label": "bill, calculation"
}
{
"type": "synonym",
"reading": "ใใใใใ",
"label": "bill, calculation"
}
When Creating New Entries
When creating new entries (e.g., via prompts/newentries.md), add cross-references as part of entry creation:
-
Always add prominent_see_also for:
- Transitive/intransitive pair (if both entries exist)
- N/Nใใ pair (if both entries exist)
- Obvious homophones that learners would confuse
-
Add cross_references for:
- Direct antonyms
- Keigo equivalents
- Close synonyms with clear distinctions
- Other relevant relationships
-
Check if the target entry exists using check_duplicate.py or the entries index:
- If yes: include
target_id and add a back-link on the target entry
- If no: create a forward reference (reading + headword only)
-
For back-links on existing entries: When you add a cross-reference pointing to an existing entry, also add a reciprocal reference on that target entry pointing back to the new entry.
Priority Order
When adding references to entries, prioritize:
-
HIGH โ Always add if applicable:
- Transitive/intransitive pairs โ
prominent_see_also
- N/Nใใ pairs โ
prominent_see_also
- Easily confused homophones โ
prominent_see_also
- Keigo equivalents โ
cross_references (keigo)
- Direct antonyms โ
cross_references (antonym)
-
MEDIUM โ Add when natural:
- Close synonyms with clear distinction (synonym)
- Particle contrasts (contrast)
- Related compounds (related)
-
LOW โ Add sparingly:
- Thematic groupings
- General see_also references
Extracting from Notes
The notes field often contains vocabulary that should be cross-referenced. Look for:
Patterns to Extract
-
Pair verbs:
- "Pair: {้|ใ}ใพใ" or "PAIR VERB: ..."
- "The intransitive counterpart is ..."
-
Antonyms:
- "Opposite: {้|ใ}ใใ"
- "Antonym: ..."
-
Keigo:
- "{ๅฌ|ใ}ใ{ไธ|ใ}ใใ (honorific)"
- "Humble form: ใใใ ใ"
-
Related words:
- Words in furigana notation within COMMON PATTERNS
- Nouns derived from verbs: ้ฃในใ โ ้ฃใน็ฉ
Automated Extraction
Run the extraction script to find potential references:
python3 build/extract_references.py
python3 build/extract_references.py --apply
python3 build/extract_references.py --id 00396_taberu
Note: The extraction script now performs immediate resolution. When a target entry exists, the extracted reference automatically includes target_id.
Hardening References
The harden_references.py script scans entries and adds target_id to resolvable cross-references. This "hardens" forward references into direct ID-based references once the target entry exists.
python3 build/harden_references.py
python3 build/harden_references.py --apply
python3 build/harden_references.py --id 00485_shimeru
When to run:
- After adding new entries that are targets of existing forward references
- Periodically to ensure all resolvable references have
target_id
- Before releases to maximize resolution coverage
Handling Non-Existent Entries
Important: You can add references to entries that don't exist yet.
- Use
reading as the primary key (required)
- Include
headword for display purposes
- The link will be marked as "pending" in the web interface
- When the target entry is created, the link automatically becomes active
This allows you to:
- Plan future entries
- Track vocabulary relationships before full coverage
- Show learners related vocabulary even if not yet in dictionary
Validation
After adding references, validate:
python3 build/validate.py --id {entry_id}
The validator checks:
- Required fields present (type, reading)
- Valid type values
- Reading is valid hiragana
- No self-references
- Homonym mismatches โ warns when a headword is specified but doesn't match any existing entry with that reading
- Stale target_id โ ERRORS when
target_id points to a non-existent entry
- Hardenable references โ warns when a reference could be hardened (target exists but no
target_id)
Validation Messages
| Type | Meaning | Action |
|---|
| ERROR: Stale target_id | target_id points to deleted entry | Remove or update target_id |
| WARNING: Hardenable | Reference resolvable but missing target_id | Run harden_references.py --apply |
| WARNING: Homonym mismatch | Headword doesn't match any entry with that reading | Verify correct homonym or wait for entry creation |
Quality Checklist
Symmetry Requirements
Cross-references should be bidirectional for most relationship types. The table below summarizes when back-links are required vs. optional:
| Relationship | Back-link Required? | Via |
|---|
| Transitive/intransitive pair | Always | prominent_see_also both ways |
| N/Nใใ pair | Always | prominent_see_also both ways |
| Homophones (confusable) | Always | prominent_see_also both ways |
| Antonym | Usually | cross_references (antonym) both ways |
| Keigo | Usually | cross_references (keigo) both ways within group |
| Synonym | Case-by-case | cross_references (synonym) โ add back-link if genuinely helpful |
| Contrast | Case-by-case | cross_references (contrast) |
| Related | Optional | cross_references (related) |
| See also | Optional | cross_references (see_also) |
Checking symmetry
Use the asymmetry report to find one-way references:
python3 build/find_merge_candidates.py --asymmetry-only
Use the cluster linter to find incomplete semantic groups:
python3 build/check_semantic_clusters.py
Cluster processing
When fixing symmetry issues, process related entries together as a cluster rather than one at a time. This ensures both sides of a relationship are updated in the same session. See the "Cluster Mode" section in prompts/add_cross-references.md for the detailed workflow.