@leonsilicon/moedict-data
v0.202603.0
Published
教育部重編國語辭典修訂本資料檔 (Ministry of Education Revised Mandarin Chinese Dictionary data) as parsed JSON, with TypeScript types.
Maintainers
Readme
@leonsilicon/moedict-data
教育部重編國語辭典修訂本 的資料檔,以 JSON 形式打包並附帶 TypeScript 型別。
Parsed JSON of the Ministry of Education Revised Mandarin Chinese Dictionary (Republic of China), packaged for Node.js with accurate TypeScript types. Source data is from g0v/moedict-data.
The dataset contains 161,197 entries including characters, words, idioms, with bopomofo, pinyin, definitions, examples, quotes, and synonyms/antonyms.
Install
npm install @leonsilicon/moedict-dataUsage
import dict from "@leonsilicon/moedict-data";
console.log(dict.length); // 161197
const entry = dict.find((e) => e.title === "中文");
console.log(entry?.heteronyms[0]?.pinyin); // "zhōng wén"The JSON file is also exposed directly:
import dict from "@leonsilicon/moedict-data/dict-revised.json" with { type: "json" };Schema
interface Entry {
title: string;
heteronyms: Heteronym[];
radical?: string;
stroke_count?: number;
non_radical_stroke_count?: number;
}
interface Heteronym {
definitions: Definition[];
bopomofo?: string;
pinyin?: string;
}
interface Definition {
def: string;
type?: string; // 名 / 動 / 形 / ...
quote?: string[]; // 古典引文
example?: string[]; // 例句
link?: string[]; // 相關連結
synonyms?: string; // 近義詞 (comma-separated)
antonyms?: string; // 反義詞 (comma-separated)
}Building
The shipped dict-revised.json is generated from data/dict-revised.json.xz:
bun run parseThis requires the xz binary on $PATH.
License
MIT. Dictionary data is © 中華民國教育部 and distributed under the terms used by g0v/moedict-data.
