en.wiktionary.org-wiki-scx-han-ids-page-text
v0.20260501.0
Published
Wiktionary page text for every Han-script character (Script_Extensions=Han) plus every component recursively referenced from those pages' ids= templates, extracted from the English Wiktionary dump and exposed via per-character dynamic imports.
Maintainers
Readme
en.wiktionary.org-wiki-scx-han-ids-page-text
Wiktionary page text for every Han-script character (Unicode Script_Extensions=Han), plus every component recursively referenced from those pages' ids= template fields, extracted from the English Wiktionary XML dump and shipped as per-character dynamic imports.
Each character maps to an async function that lazy-loads only the JSON bucket it lives in, so consumers pay for the characters they actually look up — not the entire dataset.
Install
npm install en.wiktionary.org-wiki-scx-han-ids-page-textUsage
import wiktionaryPages from "en.wiktionary.org-wiki-scx-han-ids-page-text";
const value = await wiktionaryPages["漢"]();
// value is either the raw wikitext (string) or a redirect target
// represented as a single-element tuple: [string].Return value shape
string— the raw wikitext of that character's Wiktionary page.[string]— the page is a redirect; the array contains the normalized target title.
import type { WiktionaryPageValue } from "en.wiktionary.org-wiki-scx-han-ids-page-text";
// WiktionaryPageValue = string | [string]How the data is generated
scripts/parse.ts streams the Wiktionary pages-articles-multistream dump and:
- Scans the index for titles whose every code point matches
\p{Script_Extensions=Han}— the seed set. - Decompresses only the bz2 sub-streams that contain seed titles and extracts those pages.
- Parses every fetched page's
{{...|ids=…}}template fields (IDS = Ideographic Description Sequence, the Unicode notation that uses Ideographic Description Characters like⿰/⿱/⿻to describe how a Han character decomposes into components), gathers each single component code point referenced inside (skipping the IDCs themselves atU+2FF0–U+2FFFandU+31EF, plus ASCII, CJK punctuation, and fullwidth forms), and recursively fetches any newly-referenced titles that exist in the dump's index. - Repeats step 3 until no new references are discovered, then writes:
unicode/<hi-byte>xx.json— bucketed page data, keyed by the high byte of each title's first code point.index.js/index.d.ts— the default-exportedwiktionaryPagesmap of character → dynamic import.
To regenerate from a fresh dump:
node --experimental-strip-types scripts/parse.ts \
path/to/enwiktionary-YYYYMMDD-pages-articles-multistream.xml.bz2 \
path/to/enwiktionary-YYYYMMDD-pages-articles-multistream-index.txt.bz2Requires bzip2 on PATH.
Non-Han glyphs pulled in via ids=
Versus en.wiktionary.org-wiki-scx-han-page-text, this package additionally ships every non-Han glyph that appears inside a Han page's ids= field. Wiktionary IDS authors frequently borrow Kana, Bopomofo, geometric shapes, etc. as visual stand-ins for components that have no encoded code point of their own. The Referenced by column lists Han titles whose ids= field contains the glyph.
| Char | Codepoint | Unicode block | Referenced by |
|---|---|---|---|
| ʓ | U+0293 | IPA Extensions | 𠍋 |
| ॸ | U+0978 | Devanagari | 𦹗 |
| ∾ | U+223E | Mathematical Operators | 𢀓 |
| ◇ | U+25C7 | Geometric Shapes | 𠄷 |
| ◊ | U+25CA | Geometric Shapes | 𤕈 |
| ➿ | U+27BF | Dingbats | 𡦹 |
| は | U+306F | Hiragana | 𭁇 |
| コ | U+30B3 | Katakana | 𠁲, 𠂶, 𠂼 … (51 total) |
| サ | U+30B5 | Katakana | 𬻀 |
| ス | U+30B9 | Katakana | 𢀖, 𬽡, 𮌇 |
| タ | U+30BF | Katakana | 罗 |
| チ | U+30C1 | Katakana | 刋 |
| ツ | U+30C4 | Katakana | 𫝂 |
| テ | U+30C6 | Katakana | 𫝆 |
| ノ | U+30CE | Katakana | 𣘺 |
| モ | U+30E2 | Katakana | 𪜈 |
| ユ | U+30E6 | Katakana | 𠀌, 𠇛, 𠇡 … (15 total) |
| リ | U+30EA | Katakana | 𠇬, 𱍬, 𱍭 … (9 total) |
| ㄣ | U+3123 | Bopomofo | 𪜀, 专 |
| ㅿ | U+317F | Hangul Compatibility Jamo | 㐃 |
| ㆳ | U+31B3 | Bopomofo Extended | 𠇇 |
| 𛀲 | U+1B032 | Kana Supplement | 𠆭 |
| 𛂦 | U+1B0A6 | Kana Supplement | 𭤪 |
License
MIT
