# RIME Dictionary File Specifications for Custom Entries: A Complete Guide

> Learn RIME dictionary file specifications for custom entries. Understand the YAML format for zi dict and lianxiang dict files with plain text TAB separation and pinyin input.

- Repository: [amzxyz/rime-lmdg](https://github.com/amzxyz/rime-lmdg)
- Tags: how-to-guide
- Published: 2026-02-24

---

**RIME dictionary files in the amzxyz/rime-lmdg repository are plain-text YAML files with a structured metadata header followed by TAB-separated entries containing Chinese text, space-delimited pinyin, and an optional integer weight.**

The RIME-LMDG project provides a comprehensive Chinese input method dataset organized into specialized dictionary files. Understanding the exact file specifications allows you to extend these dictionaries with custom characters, phrases, and poetry lines while maintaining compatibility with the Rime input method engine.

## File Structure and Format Specification

All dictionary files in the repository follow a consistent format consisting of a YAML header block and a delimited entry list.

### The YAML Header Block

Each dictionary begins with a metadata section written in YAML syntax:

```yaml

# Rime dictionary

# encoding: utf-8

# https://github.com/amzxyz/RIME-LMDG

---
name: <dictionary_name>      # e.g., zi, lianxiang, shici

version: "LTS"               # free-form version string

sort: by_weight              # currently only "by_weight" is supported

...

```

Lines beginning with `#` are comments ignored by the parser. The three dots (`...`) on a separate line mark the definitive end of the YAML header; all subsequent content is parsed as dictionary entries.

### Entry Format: The Three-Field Structure

After the header delimiter, each line represents one entry using **TAB characters** (not spaces) to separate three fields:

```

<文字>    <拼音>    <权重（可选）>

```

- **文字** – The Chinese word or phrase. Multi-character entries may include spaces within the text field.
- **拼音** – Space-separated Hanyu Pinyin syllables. Syllables may include tone marks (e.g., `ā`, `ǒ`) or use neutral tone representations.
- **权重** – An optional integer representing frequency weight. Higher values increase candidate priority. If omitted, Rime defaults the weight to `1`.

## Common Dictionary Types in RIME-LMDG

The repository organizes entries into distinct dictionaries by purpose and word length. Each resides in the `wanxiang/dicts/` directory.

### Single-Character Dictionary (zi.dict.yaml)

The [`wanxiang/dicts/zi.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/zi.dict.yaml) file contains base single-character entries. This dictionary serves as the foundation for character-level input.

Example entry format:

```yaml
啊    a    915
阿    ā    749

```

### Association Long-Word Dictionary (lianxiang.dict.yaml)

The [`wanxiang/dicts/lianxiang.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/lianxiang.dict.yaml) file stores "联想" (association) entries—phrases of five or more characters that appear as predictive candidates.

Example entry:

```yaml
阿巴二氏病    ā bā èr shì bìng    1

```

### Classical Poetry Dictionary (shici.dict.yaml)

The [`wanxiang/dicts/shici.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/shici.dict.yaml) file contains lines from classical poetry and song lyrics, allowing users to input entire poetic phrases.

Example entry:

```yaml
书愤    shū fèn    242

```

### Merged Reference Dictionary (full.dict.yaml)

The [`wanxiang/dicts/full.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/full.dict.yaml) provides a concatenated, read-only view of all dictionaries for quick lookup and reference. Entries in this file typically omit weight values, serving as a master index rather than an active input source.

## Practical Examples for Adding Custom Entries

### Adding a Rare Character to zi.dict.yaml

To extend the base character set, edit [`wanxiang/dicts/zi.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/zi.dict.yaml) and append your entry after the `...` delimiter:

```yaml

# Rime dictionary

# encoding: utf-8

# https://github.com/amzxyz/RIME-LMDG

---
name: zi
version: "LTS"
sort: by_weight
...

# Existing entries …

啊    a    915
阿    ā    749

# ---- Your custom entry below ----

𪚥    ā    42        # a rare character with weight 42

```

Ensure you use a **single TAB character** between each field.

### Adding a Long Phrase to lianxiang.dict.yaml

For phrases five characters or longer, modify [`wanxiang/dicts/lianxiang.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/lianxiang.dict.yaml):

```yaml

# rime dictionary

# encoding: utf-8

# https://github.com/amzxyz/RIME-LMDG

# ------- 联想词库5字及以上长词-------

---
name: lianxiang
version: "LTS"
sort: by_weight
...
阿巴二氏病    ā bā èr shì bìng    1

# ---- Your custom phrase ----

星光璀璨的夜空    xīng guāng cuǐ càn de yè kōng    3

```

### Adding Poetry Lines to shici.dict.yaml

To input classical phrases, edit [`wanxiang/dicts/shici.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/shici.dict.yaml):

```yaml

# Rime dictionary

# encoding: utf-8

# https://github.com/amzxyz/RIME-LMDG

# ------- 诗词-------

---
name: shici
version: "LTS"
sort: by_weight
...
书愤    shū fèn    242

# ---- Your custom poem line ----

清风徐来柳絮飞    qīng fēng xú lái liǔ xù fēi    5

```

## Deployment and Testing

After modifying any dictionary file, you must redeploy the Rime schema to compile the changes into the binary format used by the input method.

```bash

# Reload the schema to recognize new entries

rime_deploy

```

Once deployed, type the pinyin sequence of your custom entry in any Rime-enabled input method to verify it appears in the candidate list with the assigned weight.

## Summary

- **RIME-LMDG** dictionaries use a YAML header followed by TAB-delimited entries in `wanxiang/dicts/`.
- Each entry requires three fields: Chinese text, space-separated pinyin, and an optional weight integer.
- **zi.dict.yaml** handles single characters, **lianxiang.dict.yaml** handles long phrases (≥5 chars), and **shici.dict.yaml** contains classical poetry.
- The weight field determines candidate priority; higher values appear first in suggestions.
- Always separate fields with **TAB characters**, not spaces, to ensure proper parsing.
- Run `rime_deploy` after editing to compile dictionary changes.

## Frequently Asked Questions

### What is the difference between zi.dict.yaml and lianxiang.dict.yaml?

**zi.dict.yaml** ([`wanxiang/dicts/zi.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/zi.dict.yaml)) contains single-character entries forming the base vocabulary, while **lianxiang.dict.yaml** ([`wanxiang/dicts/lianxiang.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/wanxiang/dicts/lianxiang.dict.yaml)) specifically holds multi-character association phrases of five or more characters. The input method references zi.dict.yaml for basic character input and lianxiang.dict.yaml for predictive long-word suggestions.

### Can I omit the weight field in a RIME dictionary entry?

Yes. The weight field is optional. If you provide only the text and pinyin fields separated by a TAB, Rime automatically assigns a default weight of `1`. However, explicit weights are recommended for custom entries to control their priority relative to existing vocabulary.

### How do I reload RIME after editing dictionary files?

After saving changes to any [`.dict.yaml`](https://github.com/amzxyz/rime-lmdg/blob/main/.dict.yaml) file in the `wanxiang/dicts/` directory, execute the `rime_deploy` command in your terminal. This command compiles the plaintext dictionaries into the binary format Rime uses for lookup tables. Without redeployment, new entries will not appear in the candidate list.

### Why does my custom entry not appear in the candidate list?

First, verify that fields are separated by **TAB characters** rather than spaces, as Rime strictly requires TAB delimiters. Second, confirm the YAML header ends with `...` on its own line before your entries begin. Finally, ensure you have run `rime_deploy` and that your active Rime schema includes the modified dictionary in its `dictionary:` or `import_tables:` configuration.