Next-word prediction dictionaries for RIME input method — Simplified / Traditional / Merged Chinese.
After you commit a character or word, the candidate bar automatically suggests the next common character or word — type 我 and it offers 们, type 問 and it offers 題. This works with any Chinese RIME schema (Cangjie, Pinyin, Wubi, Zhuyin, …); it is not tied to a particular input method.
The files are binary dictionaries in the Rime::Predict/1.0 format, read by the official librime-predict plugin.
The configuration example below uses Cangjie 5 (Cangjie5_SC) purely for illustration. The dictionary itself is schema-independent — Pinyin and other schemas work the same way.
| File | Content | Heads | Entries | Freq. coverage | Size |
|---|---|---|---|---|---|
dist/predict-zhs.db |
Simplified only | 4,169 | 52,780 | 99.1% | 524 KB |
dist/predict-zht.db |
Traditional only | 4,409 | 54,381 | 88.5% | 550 KB |
dist/predict-merged.db |
Merged (Simplified-first, Traditional alongside) | 6,061 | 94,810 | — | 924 KB |
src/*.tsv |
Plain-text sources (head ⇥ continuation ⇥ weight) for audit / rebuild |
||||
raw/*.txt |
Upstream raw association lists from chinesecj.com |
Naming:
zhs= Simplified,zht= Traditional,merged= both combined. RIME loads a file namedpredict.db(set bypredictor/dbin the schema). So "enabling a version" means copying the version you want topredict.db, or pointingpredictor/dbat a specific filename.predict.dbitself is not committed to this repo — create your own copy.
- Pick a
.dbfromdist/, copy it into your RIME user directory (%APPDATA%\Rime\on Windows), renaming it topredict.db— or keep its name and reference it directly in step 2. - Enable the predictor in
<your_schema>.custom.yaml(example usescangjie5_sc.custom.yaml):
patch:
translator/enable_sentence: false
translator/enable_encoder: false
translator/enable_completion: false
translator/enable_user_dict: false
"engine/processors/@before 0": predictor
"engine/translators/@before 0": predict_translator
"switches/+":
- { name: prediction, states: [ Prediction Off, Prediction On ], reset: 1 }
predictor:
db: predict.db # or point directly at predict-zht.db, etc.
max_candidates: 6- Redeploy from the tray menu. Type
我and the candidate bar should show我们 · 我见 · 我行我素 ….
A ready-to-copy config lives at docs/example.custom.yaml.
Switching versions (drop multiple .db files into %APPDATA%\Rime\, change one line):
predictor:
db: predict-zhs.db # or predict-zht.db / predict-merged.dbThen redeploy.
- Simplified
predict-zhs.db— for Simplified-only input. Cleanest. 99.1% frequency coverage. - Traditional
predict-zht.db— for Traditional-only input. 88.5% coverage (see Technical notes). - Merged
predict-merged.db— for mixed input with Simplified as the primary (recommended for daily use).- Heads that differ by form (問≠问, 愛≠爱, 國≠国 …) have naturally distinct keys, so the two datasets never interfere — zero cross-talk.
- Heads with identical form (我 / 中 / 你 …) share one key, with Simplified first and Traditional trailing, so Simplified input is virtually unaffected.
chinesecj.com association lists (GBK/GB18030)
├─ jtlx.txt Simplified source
└─ ftlx.txt Traditional source
│ ① Parse: split each line into (head → [continuations...])
│ ② Sort: reorder continuations by commonness
│ (the raw lists are in phonetic order, so this step is needed)
│ frequencies taken from rime-ice cn_dicts/base.dict.yaml
│ Traditional words are first converted to Simplified via OpenCC t2s,
│ then looked up — one consistent frequency ruler
│ ③ Merge (merged only): Simplified tier first, Traditional tier after,
│ identical-form duplicates removed
▼
head ⇥ continuation ⇥ weight (src/predict-*.tsv)
│ ④ compiled to binary by librime-predict's build_predict tool
▼
dist/predict-*.db (Rime::Predict/1.0)
The .db files are binary and cannot be hand-edited. To change content, edit the matching .tsv and recompile, or rerun the whole pipeline.
- Fine-tune ordering / add / remove words: edit
src/predict-*.tsv(head ⇥ continuation ⇥ weight; the row order under a head = the candidate display order), then recompile withbuild_predict. - New upstream list from chinesecj.com: replace
raw/jtlx.txt/raw/ftlx.txtand rerun the pipeline.
build_predictlinks against librime; building it natively on Windows is fiddly. A Linux environment is the easy path for rebuilds.
- Display order = the storage row order in the db, not re-sorted by weight.
librime-predictreads candidates sequentially up tomax_candidates. So "common words first" is achieved by the row order when generating the TSV; theweightcolumn is recorded for reference only. - Traditional coverage is 88.5% (lower than Simplified's 99.1%): rime-ice is Simplified-oriented, and a few Taiwan-specific terms don't match after t2s conversion (e.g. 愛滋病→爱滋病, 阿茨海默症). Those words get no frequency and sort after the common words of their head, but they remain in the candidate list. Common words (問題, 我們, 愛情 …) all convert and sort correctly.
- Merged heads with identical form trail a few Traditional "ride-along" candidates near the end of
max_candidates; Simplified input barely notices. - librime version: compiled with librime 1.10; the
Rime::Predict/1.0format is stable across versions (the loader only checks theRime::Predict/prefix), and loads fine on Weasel 1.13.x. If candidates ever stop appearing or the log reports a predict-db error, just recompile. - Keep
simplificationOFF (default 漢字 state), otherwise everything is forced to Simplified, breaking bidirectional Simplified/Traditional lookup. (This is a schema setting unrelated topredict.db, noted here for completeness.)
This project would not exist without the work of others. Sincere thanks to:
- chinesecj.com (倉頡之友) — the original Chinese association word lists (
jtlx.txt/ftlx.txt) that form the backbone of these dictionaries. - iDvel/rime-ice (雾凇拼音) — word-frequency data from
cn_dicts/base.dict.yaml, used to rank the continuations. - rime/librime-predict — the prediction engine and the
build_predicttool that compiles the.dbfiles. - RIME / librime — the underlying input method engine.
- OpenCC — Traditional↔Simplified conversion (
t2s).
If you redistribute or build upon this work, please keep this attribution.
Released under the GNU General Public License v3.0 (see LICENSE), following the license of the upstream rime-ice frequency data this work is derived from.
The upstream association word lists come from the Cangjie Platform 2022 (chinesecj.com), whose authors state on their official forum that the platform and its code tables are "completely free and open, welcoming everyone to help promote Cangjie" (source). This project redistributes the raw/ lists in that spirit, with attribution. The underlying Cangjie input method is patent-free — released by Chu Bong-Foo (朱邦復) for free use and modification. The sibling project Jackchows/Cangjie5, likewise derived from the Cangjie Platform tables, follows the same approach.
Last updated: 2026-06-26