Skip to content

wildthyme/rime-xiuzheng

 
 

Repository files navigation

introduction

xiuzheng (zhengma revised) is a shape-based input method based on zhengma. those not already familiar with zhengma would do well to look first at the guides linked at the bottom of this page. those not familiar with rime will need to look up a guide to install it and add a new schema.

xiuzheng’s design goals are as follows:

  • xiuzheng should be fast for a skilled typist.
    • like zhengma, it uses a maximum of 4 keys/char, fewer keystrokes than its better-known rival cangjie @ 5 keys/char.
    • because of its many briefs for common phrases, it requires fewer keystrokes than the best pinyin IME (viz. double pinyin with tones @ 3 keys/char).
    • it aims to match the english average rate of 4.79 letters/word, although this has not yet been measured.
  • xiuzheng should be low-ambiguity and suitable for blind typing through muscle memory without producing errors.
    • phonetic input methods (pinyin/zhuyin) depend on a feedback loop in which the user stops typing to look at a list of word matches and choose the one they intend. this is often acceptable to people who don’t know any better, as long as they can type full phrases and rely on the software to predict what word they want based on context. however, it is much slower and more error-prone than touch-typing a language like english in phonetic script, where the user can build muscle memory and trust that what you type is what you get.
    • like zhengma and cangjie, xiuzheng makes all commonly-used single characters touch-typable, because you type the character shape, not the sound.
    • unlike zhengma and cangjie, xiuzheng also makes commonly-used words and phrases touch-typable, by assigning them low-ambiguity shortcuts.
  • xiuzheng should be intuitive.
    • like in zhengma and unlike cangjie, the method to type a character is predictable based on the stroke order for writing it.
    • xiuzheng should be familiar and easy to adjust to for existing users of zhengma, because it retains the same 4-key character codes and makes shortcuts more predictable.
  • xiuzheng should support multiple regions and languages.
    • like zhengma and cangjie, the low ambiguity of xiuzheng is suited to typing classical chinese.
    • unlike zhengma, xiuzheng provides separate word-dictionaries for traditional and simplified characters, so that you don’t have to choose from a suggestion list to avoid typing the simplified version of a word.
    • in the hope of enabling some of the same stylistic freedom available in handwriting, some common variant characters are supported: 臺/台、對/対、個/亇、第/㐧、聽/咡、點/奌,etc.
    • in future, i would like to produce dictionaries for east asian languages besides mandarin, but i am not as familiar with those and will need to go about it carefully.

this is a new project, and i am very open to comments or suggestions for refining the system.

comparison with zhengma

xiuzheng retains zhengma’s original system of character decomposition and 4-key character codes, but alters the system of briefs for typing the most commonly-used characters and long words. the original version of zhengma assigns long words to 4-key codes, resulting in many collisions between different dictionary entries. by my calculations, if you were to type the dictionary with your eyes closed using zhengma, unable to choose the correct list from the suggestion dropdown, you would get at least 44% of words wrong. by using longer codes for longer words, xiuzheng reduces this error rate to ~6%. to compensate for the use of longer codes, many common words are also assigned shortcuts: unt 為什麼、 ae 一直、 jc 嗎,etc.

here, CamelCase is used to indicate different roots. thus the root 女 is written Zm, the root 生 is written Mc, and the sequence of roots for 姓 is ZmMc. in practice, everything is typed in lowercase.

examples:

phrasezhengma codexiuzheng code
ZmMcZmMc
女生ZmMcZmMcV
報導BUWUBW, BYXWUN
報道BUWUBYXWND
騙子CWYaCWLYa
駝子CWYaCWRYa

xiuzheng also makes the process for deriving 3-key shortcuts more intuitive, by making them more similar to 4-key long codes. in a 4-key long code, the most important roots are the first, last, and penultimate. zhengma 3-key shortcuts use the first three roots. this is confusing, because second and third codes may not appear in the long code at all. xiuzheng 3-key shortcuts instead retain the first, last, and penultimate.

characterfull code sequencefour-codezhengma shortcutxiuzheng shortcut
KoWwJLkBUoKoBUKW(J)K(B)U

another benefit to this change is that the combination of first and last codes differentiates characters with less ambiguity than the combination of the first few codes, producing fewer collisions.

code system

single character

original codefull codeshort codevery short code
AAAA
AbAbAbAb
ACdACdACdAC
AbcDAbcDAbDAD
AC(d)EfACEfACEAE
AbCdAbCdAbCAC
AbC(d)E(f)AbCEACEAE
AbcD(e)FgAbcFAbFAF
Ab(Cd)E(f)GhAbEGAEGAG

full word

2-char codes may take the forms 2+2+v=5, 2+3=5, 3+2=5, or 3+3=6, meaning the codes are 5–6 characters long. 3-char codes likewise range from 2+2+2=6 to 3+3+3=9 characters long. longer words use only the two keys per character: the first letter of the first root and the first letter of the last root. thus 4 chars × 2 roots = 8 keys, 5 chars × 2 roots = 10 keys, etc.

​# of charslong codeshortcut
1A(B)CDAD or ACD
2AB + CD = ABCDVAC(V)
2AB(C) + DE(F) = AB(C)DE(F)AD(V)
3AB(C) + DE(F) + GH(I) = AB(C)DE(F)GH(I)ADG
4+A(BC)D + E(FG)H + I(JK)L + M(NO)P + … = ADEHILMP…

codes by length

it may seem odd that 3-char words take up to 9 keys, while 4-char words only take 8. however, 4-char words are rarer and so can afford shorter codes without becoming ambiguous. 3 chars × 3 keys and 4 chars × 2 keys makes for more intuitive arithmetic than any other option i have experimented with.

code lengthresultexample
11-char word shortcutl 用 (LdBi)
21-char full codeko 小 (Ko)
21-char word shortcutpe 針 (PEd)
22-char word shortcutpz 所以 (pxp+zso)
32-char word shortcut + vgjv 歷史 (gmi+jos+v)
31-char full codefka
31-char word shortcutwdz 安 (WdZm)
33-char word shortcutefi 基本上 (ecb+fa+ida)
41-char full codezmmc 姓 (ZmMc)
52-char word (2+2+v)zmmcv 女生 (zm+mc+v)
52-char word (2+3)kokbd 小時 (ko+kbd)
62-char word (3+3)pxpzso 所以 (pxp+zso)
63-char word (2+2+2)giaawd 不一定 (gi+aa+wd)
73-char word (2*2+3)greckai 尤其是 (gr+ec+kai)
83-char word (2+2*3)gdkomocy 大少爺 (gd+kom+ocy)
84-char word (2+2+2+2)agchbyrs 天長地久 (ag+ch+by+rs)
93-char word (3+3+3)uyunedtzz 為什麼 (uyu+ned+tzz)
10+5+-char word (2×5+)klnbcbdxja 常任理事國 (kl+nb+cb+dx+ja)

reference codes

1-key shortcuts (traditional version)

A 一B 都C 長D 把E 著
F 要G 在H 到I 上J 中
K 是L 用M 我N 的O 會
P 所Q 月R 亇S 就T 次
U 為V 沒W 這X 又Y 了
Z 將

1-key shortcuts (simplified version)

A 一B 都C 长D 把E 其
F 要G 在H 到I 上J 中
K 是L 用M 我N 的O 个
P 所Q 月R 比S 就T 次
U 为V 没W 這X 对Y 了
Z 將

zhùyīn

symbolsdecompositionlatin hint
Ryb
Rsp
Ldm
Hf
AYmv
MYdd
Hdt
Yn
MYml
Zdg
AZk
Grng
Ggh
Zij
Zq
Tgn
AIx
ZiAzh
Oich
Xmsh
JdSr
Yz
AZXc
Zss
UdIa
AIHo
EdHe
EdZie
AZMai
Ydaei
ZZsao
Xsou
XZXan
ZXen
Grang
Zeng
Nder
Ayi
Oswu
Ziyu
ALi(z)i
RyJbb
ZdJgg
ZiJjj
YJzz
OsAir
AIZmoo
YZAe
UdIJna
AIZmJno
YZAJne
AJni
IJni
OsJnu
AZMJnai
ZZJnau
UdLdIam
ALdIHom
Biong
LdIm
GrIng
Ry-p
MYd-t
Zd-k
AZ-k*
Gg-h
Zmgw
AZmkw
ZAeo
Oa

katakana

Økstnhmyrw
aYMYmEdMRsGdOYSYIAYIY
iNBiTdAMGdBdRrVKdMb
uIIYRRsATdMXsYZsXRd
eBiMaMYzABdMWsYdaXoZYIA
oDMXTdIdYFAHdXbJYA
nSA

zhengma learning resources

todo

  • use new word priority list
  • detailed installation instructions
  • support region-specific decompositions (e.g. 儿 Rd vs 八 O in 空 WdRdBi / WdOBi)
  • mandarin (tc/sc) versions of this page
  • rip wiktionary/kaikki for dictionary
  • support more obscure variant and vietnamese characters (many had incorrect codes in the old zhengma file and were collectively struck until they can be checked carefully)
  • hokkien/hk-canto/vietnamese/japanese support?

changelog

0.4

  • codes for 3-char words vary at 6–9 keys instead of strictly 9. this proves significantly more intuitive.
  • added 2 key + v shortcuts for more 2-char words
  • added full reverse lookup dictionaries
  • fix: words with 用 were not receiving codes
  • fix: 同 appeared as ldaj alone but ld in words (now laj in words)
  • handle terms with latin letters in them: AA 制 = A+A+MbLiKd = aamlk; CP 值 = C+P+NEdLo = cpnel
  • codes for roots are demoted to make room for more useful shortcuts (e.g. 有 = gq so the root for 豕 has to be assigned gqa instead)
  • some very WIP code for japanese mode

0.3

fixed phrase encoder

0.2

added simplified chinese

0.1

initial release

About

Xiuzheng for Rime 中州韻修鄭輸入法

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%