hanja: add single-character dictionary data

This commit is contained in:
2026-08-12 19:29:11 +09:00
parent 0216cc3c8a
commit 4e1c15dde4
12 changed files with 29400 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ input boundary, or an explicit mode change. Backspace first removes pending
romaji, then accumulated kana. The Japanese modes support doubled consonants
and combinations such as `nya`, `nnya`, and `matcha`.
Modes are selected with Ctrl and one letter:
Modes and temporary searches use Ctrl and one letter:
```text
Ctrl+N Japanese Hiragana and Kanji conversion
@@ -29,12 +29,13 @@ Ctrl+S Korean Hangul
Ctrl+T English passthrough
Ctrl+V Vietnamese Telex compatibility mode
Ctrl+E Emoji and symbol search
Ctrl+H One-shot Hanja search (from Korean mode)
Ctrl+P Toggle popup preedit
```
While candidates are visible, Up and Down move the selection, Enter accepts
the selected candidate, and an unmodified `1`-`9` selects the corresponding
visible row. Tab cycles emoji search results. `0` commits an unconverted
visible row. Tab cycles temporary search results. `0` commits an unconverted
language reading. Escape cancels the current composition. Ctrl, Alt, or
Super combined with a number does not select a candidate.
@@ -46,6 +47,13 @@ English aliases or the active language's input rules, including Japanese
Ctrl+E → smile → Enter → 😀
```
Hanja search is available only from Korean mode and returns to Korean mode
after one conversion. Press Ctrl+H, type exactly one Hangul syllable with
the normal 2-beolsik Shift and Caps Lock behavior, then select with Up, Down,
Tab, Enter, or `1`-`9`. Escape cancels the search; when there is no match,
Enter commits the Hangul reading. It does not convert words or text already
surrounding the cursor.
## Build and test
The supported build uses Docker so host and container toolchains are not
@@ -76,14 +84,15 @@ build is still possible with the dependencies and Plan 9 setup recorded in
`Dockerfile`; use `make all`, `make check`, and `make bench` inside that
environment.
After editing `map/emoji.src`, regenerate and verify its dictionary with:
After editing an input source, regenerate and verify its dictionary with:
```sh
map/mkemoji >map/emoji.dict
map/mkhanja >map/hanja.dict
make verify-map
```
Japanese dictionary regeneration and verification are documented in
Hanja import and Japanese dictionary regeneration are documented in
[`map/README`](map/README). The converter output is deterministic UTF-8,
tab-separated data consumable by the runtime dictionary reader.
@@ -159,6 +168,9 @@ Data and third-party provenance is recorded in
[`font/PROVENANCE`](font/PROVENANCE). The historical SKK-derived Kanji
dictionary is distributed under GPL version 2 or later; its license text is
in [`LICENSES/GPL-2.0-or-later.txt`](LICENSES/GPL-2.0-or-later.txt).
The single-character Hanja data derived from libhangul is distributed under
the BSD 3-Clause license in
[`LICENSES/BSD-3-Clause-libhangul-hanja.txt`](LICENSES/BSD-3-Clause-libhangul-hanja.txt).
The repository does not currently declare a license for the strans project
source as a whole. The licenses of bundled data, fonts, generated protocol