# Chai — data files and credits

`decomp.json` — character decomposition ("Parts" of a single character in the dictionary card), generated by
`scripts/gen-decomp.mjs`; do not edit by hand (corrections go to `scripts/data/decomp-overrides.json`).

Credits and licences of the data it is derived from:

- **Make Me a Hanzi** `dictionary.txt` (decomposition, radicals, etymology hints) — © Shaunak Kishore,
  <https://github.com/skishore/makemeahanzi>, GNU Lesser General Public License v3.0 or later (LGPL-3.0).
  The derived `decomp.json` is distributed under the same licence.
- **Make Me a Hanzi / hanzi-writer-data** stroke data (stroke order animation) — Arphic Public License.
- **CC-CEDICT** (readings, "is a word" check, simplified ↔ traditional links) — <https://cc-cedict.org>,
  Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0).
- **Unihan** (radical of characters Make Me a Hanzi does not cover, variants, definitions of rare components) —
  © Unicode, Inc., Unicode License v3.
- Character frequency: Jun Da, *Modern Chinese Character Frequency List* (2004).

`freq.json` — word frequency ranks ("Top 500 / Top 2000 / Top 5000 / Rare" badges, "Most common first" sort, the
Reader's bulk-add ranking), generated by `scripts/gen-freq.mjs`; read through `freqRank()` in `js/dict-util.js`.
Derived from:

- **FrequencyWords** (OpenSubtitles 2018, `zh_cn_50k.txt`) — © Hermit Dave, <https://github.com/hermitdave/FrequencyWords>,
  content under Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0). `freq.json` is distributed under the same licence.
- **CC-CEDICT** (filter: only real simplified headwords are kept) — CC BY-SA 4.0, as above.
- Character frequency (Jun Da, 2004, `scripts/data/char-freq.txt`) places common characters that are rare as standalone
  words (习, 汉) right after the first listed word containing them.

`placement.json`, `starter.json` — Chai's own content.

`pinyin.json` — local pinyin and word segmentation of live lecture subtitles (`js/hanzi-pinyin.js`), generated by
`scripts/gen-pinyin.mjs`. Derived from:

- **CC-CEDICT** (readings of characters and words) — <https://cc-cedict.org>, CC BY-SA 4.0.
- **FrequencyWords** (OpenSubtitles 2018, `zh_cn_50k.txt`, the 20 000 most frequent words) — © Hermit Dave, CC BY-SA 4.0.
- Character frequency (Jun Da, 2004, `scripts/data/char-freq.txt`).
`pinyin.json` is distributed under CC BY-SA 4.0.
