Thursday, 22 October 2009

Chinese input methods in SCIM - quick overview

I have LinuxMint Elyssa (based more or less on Ubuntu Hardy Heron). I have installed the SCIM framework as well as the SCIM-chinese IME for Chinese.


I would like here to cover the various input methods proposed by this IME for Simplified Chinese. There are quite a few, and I have not seen so many articles covering SCIM under this angle. For traditional Chinese, I am not quite there yet.


With my version there are five choices :


  • - Erbi - ???
  • - Erbi-QS - ???
  • - Wubi - Wubizixing, an input method based on character structure
  • - Ziranma - Ziranmashuangpin, an input method based on character pronunciation, of type shuangpin


    http://eyegene.ophthy.med.umich.edu/unicode/KeyboardLayouts/ZiRanMaPinYinKeyboard.html

  • - Smart Pinyin - zhinengpinyin (written 智能拼音 in simplified characters on the interface), a set of input methods all based on pinyin (Romanization of characters based on pronunciation)


The Smart Pinyin operates in four modes :
  • - zhong 中 or jianti display Simplified Chinese characters
  • - ying 英 : freely type in English (thus bypass the whole Chinese input method thing)
  • - fanti  繁: display Traditional Chinese characters, mostly used for Hong-Kong and Taiwan


Here the difference is only in the font - each simplified character is the equivalent of one traditional character.


Then besides choosing the character set, the user can also choose between different pinyin methods :


  • - quanpin 全拼 : quanpin (complete pinyin) uses the standard pinyin writing of a character to propose character candidates, unlike the shuangpin methods. It also has tones, available by adding a trailing digit for the phonem's tone. This is then probably the best choice for beginners in simplified Chinese. It also has an interesting feature : it supports phrases, and if you type only the respective onset consonnants in a series of phonems, it proposes phrases candidates, i.e. several characters forming a phrase.
  • - shuangping 双拼 : whereas the full pinyin rendition of a character can take up to 6 Roman characters to write a phonem, shuangpin (abbreviated pinyin) enables you to enter an abbreviated version of pinyin which only takes 2 Roman characters to represent a phonem. There are many shuangpin methods available under the Smart Pinyin umbrella, each of them  having different keystroke layouts (associating consonnants/vowels to different Roman letters)
Shuangpin in SCIM-Pinyin :
There are various shuangpin methods in SCIM simplified Chinese, available either as Ziranma or as one of the shuangpin methods proposed by Smart Pinyin.
  •  - Ziranma uses its own keystroke keyboard layout, which is well documented. See :
    http://eyegene.ophthy.med.umich.edu/unicode/KeyboardLayouts/ZiRanMaPinYinKeyboard.html
  •  -  The other methods, available through Smart Pinyin, are :
         * ShuangPin Stone
         * ShuangPin ZRM
         * ShuangPin MS
         * ShuangPin Ziguang
         * ShuangPin ABC
         * ShuangPin LiuShi
I find that the most straightforward way to look up the keystrokes for each method is to directly check inside the scim-pinyin package's source code, more specifically in source file src/scim-pinyin.cpp. In sourcecode version 0.5.91, the relevant section begins at line 193 :

static const PinyinInitial scim_shuang_pin_stone_initial_map [] =

{
SCIM_PINYIN_ZeroInitial, // A
SCIM_PINYIN_Bo, // B
SCIM_PINYIN_Ci, // C
SCIM_PINYIN_De, // D
SCIM_PINYIN_ZeroInitial, // E
SCIM_PINYIN_Fo, // F
SCIM_PINYIN_Ge, // G
SCIM_PINYIN_He, // H
SCIM_PINYIN_Shi, // I
SCIM_PINYIN_Ji, // J
SCIM_PINYIN_Ke, // K
SCIM_PINYIN_Le, // L
SCIM_PINYIN_Mo, // M
SCIM_PINYIN_Ne, // N
SCIM_PINYIN_ZeroInitial, // O
SCIM_PINYIN_Po, // P
SCIM_PINYIN_Qi, // Q
SCIM_PINYIN_Ri, // R
SCIM_PINYIN_Si, // S
SCIM_PINYIN_Te, // T
SCIM_PINYIN_Chi, // U
SCIM_PINYIN_Zhi, // V
SCIM_PINYIN_Wo, // W
SCIM_PINYIN_Xi, // X
SCIM_PINYIN_Yi, // Y
SCIM_PINYIN_Zi, // Z
SCIM_PINYIN_ZeroInitial, // ;
};


static const PinyinFinal scim_shuang_pin_stone_final_map [][2] =
{
{ SCIM_PINYIN_A, SCIM_PINYIN_ZeroFinal }, // A
{ SCIM_PINYIN_Ia, SCIM_PINYIN_Ua }, // B
{ SCIM_PINYIN_Uan, SCIM_PINYIN_ZeroFinal }, // C
{ SCIM_PINYIN_Ao, SCIM_PINYIN_ZeroFinal }, // D
{ SCIM_PINYIN_E, SCIM_PINYIN_ZeroFinal }, // E
{ SCIM_PINYIN_An, SCIM_PINYIN_ZeroFinal }, // F
{ SCIM_PINYIN_Ang, SCIM_PINYIN_ZeroFinal }, // G
{ SCIM_PINYIN_Uang,SCIM_PINYIN_Iang }, // H
{ SCIM_PINYIN_I, SCIM_PINYIN_ZeroFinal }, // I
{ SCIM_PINYIN_Ian, SCIM_PINYIN_ZeroFinal }, // J
{ SCIM_PINYIN_Iao, SCIM_PINYIN_ZeroFinal }, // K
{ SCIM_PINYIN_In, SCIM_PINYIN_ZeroFinal }, // L
{ SCIM_PINYIN_Ie, SCIM_PINYIN_ZeroFinal }, // M
{ SCIM_PINYIN_Iu, SCIM_PINYIN_ZeroFinal }, // N
{ SCIM_PINYIN_Uo, SCIM_PINYIN_O }, // O
{ SCIM_PINYIN_Ou, SCIM_PINYIN_ZeroFinal }, // P
{ SCIM_PINYIN_Ing, SCIM_PINYIN_Er }, // Q
{ SCIM_PINYIN_En, SCIM_PINYIN_ZeroFinal }, // R
{ SCIM_PINYIN_Ai, SCIM_PINYIN_ZeroFinal }, // S
{ SCIM_PINYIN_Ng, SCIM_PINYIN_Eng }, // T
{ SCIM_PINYIN_U, SCIM_PINYIN_ZeroFinal }, // U
{ SCIM_PINYIN_V, SCIM_PINYIN_Ui }, // V
{ SCIM_PINYIN_Ei, SCIM_PINYIN_ZeroFinal }, // W
{ SCIM_PINYIN_Uai, SCIM_PINYIN_Ue }, // X
{ SCIM_PINYIN_Ong, SCIM_PINYIN_Iong }, // Y
{ SCIM_PINYIN_Un, SCIM_PINYIN_ZeroFinal }, // Z
{ SCIM_PINYIN_ZeroFinal, SCIM_PINYIN_ZeroFinal }, // ;
};




static const PinyinInitial scim_shuang_pin_zrm_initial_map [] =
{
SCIM_PINYIN_ZeroInitial, // A
SCIM_PINYIN_Bo, // B
SCIM_PINYIN_Ci, // C
SCIM_PINYIN_De, // D
SCIM_PINYIN_ZeroInitial, // E
SCIM_PINYIN_Fo, // F
SCIM_PINYIN_Ge, // G
SCIM_PINYIN_He, // H
SCIM_PINYIN_Chi, // I
SCIM_PINYIN_Ji, // J
SCIM_PINYIN_Ke, // K
SCIM_PINYIN_Le, // L
SCIM_PINYIN_Mo, // M
SCIM_PINYIN_Ne, // N
SCIM_PINYIN_ZeroInitial, // O
SCIM_PINYIN_Po, // P
SCIM_PINYIN_Qi, // Q
SCIM_PINYIN_Ri, // R
SCIM_PINYIN_Si, // S
SCIM_PINYIN_Te, // T
SCIM_PINYIN_Shi, // U
SCIM_PINYIN_Zhi, // V
SCIM_PINYIN_Wo, // W
SCIM_PINYIN_Xi, // X
SCIM_PINYIN_Yi, // Y
SCIM_PINYIN_Zi, // Z
SCIM_PINYIN_ZeroInitial, // ;
};


static const PinyinFinal scim_shuang_pin_zrm_final_map [][2] =
{
{ SCIM_PINYIN_A, SCIM_PINYIN_ZeroFinal }, // A
{ SCIM_PINYIN_Ou, SCIM_PINYIN_ZeroFinal }, // B
{ SCIM_PINYIN_Iao, SCIM_PINYIN_ZeroFinal }, // C
{ SCIM_PINYIN_Uang,SCIM_PINYIN_Iang }, // D
{ SCIM_PINYIN_E, SCIM_PINYIN_ZeroFinal }, // E
{ SCIM_PINYIN_En, SCIM_PINYIN_ZeroFinal }, // F
{ SCIM_PINYIN_Ng, SCIM_PINYIN_Eng }, // G
{ SCIM_PINYIN_Ang, SCIM_PINYIN_ZeroFinal }, // H
{ SCIM_PINYIN_I, SCIM_PINYIN_ZeroFinal }, // I
{ SCIM_PINYIN_An, SCIM_PINYIN_ZeroFinal }, // J
{ SCIM_PINYIN_Ao, SCIM_PINYIN_ZeroFinal }, // K
{ SCIM_PINYIN_Ai, SCIM_PINYIN_ZeroFinal }, // L
{ SCIM_PINYIN_Ian, SCIM_PINYIN_ZeroFinal }, // M
{ SCIM_PINYIN_In, SCIM_PINYIN_ZeroFinal }, // N
{ SCIM_PINYIN_Uo, SCIM_PINYIN_O }, // O
{ SCIM_PINYIN_Un, SCIM_PINYIN_ZeroFinal }, // P
{ SCIM_PINYIN_Iu, SCIM_PINYIN_ZeroFinal }, // Q
{ SCIM_PINYIN_Uan, SCIM_PINYIN_Er }, // R
{ SCIM_PINYIN_Ong, SCIM_PINYIN_Iong }, // S
{ SCIM_PINYIN_Ue, SCIM_PINYIN_ZeroFinal }, // T
{ SCIM_PINYIN_U, SCIM_PINYIN_ZeroFinal }, // U
{ SCIM_PINYIN_V, SCIM_PINYIN_Ui }, // V
{ SCIM_PINYIN_Ia, SCIM_PINYIN_Ua }, // W
{ SCIM_PINYIN_Ie, SCIM_PINYIN_ZeroFinal }, // X
{ SCIM_PINYIN_Ing, SCIM_PINYIN_Uai }, // Y
{ SCIM_PINYIN_Ei, SCIM_PINYIN_ZeroFinal }, // Z
{ SCIM_PINYIN_ZeroFinal, SCIM_PINYIN_ZeroFinal }, // ;
};




static const PinyinInitial scim_shuang_pin_ms_initial_map [] =
{
SCIM_PINYIN_ZeroInitial, // A
SCIM_PINYIN_Bo, // B
SCIM_PINYIN_Ci, // C
SCIM_PINYIN_De, // D
SCIM_PINYIN_ZeroInitial, // E
SCIM_PINYIN_Fo, // F
SCIM_PINYIN_Ge, // G
SCIM_PINYIN_He, // H
SCIM_PINYIN_Chi, // I
SCIM_PINYIN_Ji, // J
SCIM_PINYIN_Ke, // K
SCIM_PINYIN_Le, // L
SCIM_PINYIN_Mo, // M
SCIM_PINYIN_Ne, // N
SCIM_PINYIN_ZeroInitial, // O
SCIM_PINYIN_Po, // P
SCIM_PINYIN_Qi, // Q
SCIM_PINYIN_Ri, // R
SCIM_PINYIN_Si, // S
SCIM_PINYIN_Te, // T
SCIM_PINYIN_Shi, // U
SCIM_PINYIN_Zhi, // V
SCIM_PINYIN_Wo, // W
SCIM_PINYIN_Xi, // X
SCIM_PINYIN_Yi, // Y
SCIM_PINYIN_Zi, // Z
SCIM_PINYIN_ZeroInitial, // ;
};


static const PinyinFinal scim_shuang_pin_ms_final_map [][2] =
{
{ SCIM_PINYIN_A, SCIM_PINYIN_ZeroFinal }, // A
{ SCIM_PINYIN_Ou, SCIM_PINYIN_ZeroFinal }, // B
{ SCIM_PINYIN_Iao, SCIM_PINYIN_ZeroFinal }, // C
{ SCIM_PINYIN_Uang,SCIM_PINYIN_Iang }, // D
{ SCIM_PINYIN_E, SCIM_PINYIN_ZeroFinal }, // E
{ SCIM_PINYIN_En, SCIM_PINYIN_ZeroFinal }, // F
{ SCIM_PINYIN_Ng, SCIM_PINYIN_Eng }, // G
{ SCIM_PINYIN_Ang, SCIM_PINYIN_ZeroFinal }, // H
{ SCIM_PINYIN_I, SCIM_PINYIN_ZeroFinal }, // I
{ SCIM_PINYIN_An, SCIM_PINYIN_ZeroFinal }, // J
{ SCIM_PINYIN_Ao, SCIM_PINYIN_ZeroFinal }, // K
{ SCIM_PINYIN_Ai, SCIM_PINYIN_ZeroFinal }, // L
{ SCIM_PINYIN_Ian, SCIM_PINYIN_ZeroFinal }, // M
{ SCIM_PINYIN_In, SCIM_PINYIN_ZeroFinal }, // N
{ SCIM_PINYIN_Uo, SCIM_PINYIN_O }, // O
{ SCIM_PINYIN_Un, SCIM_PINYIN_ZeroFinal }, // P
{ SCIM_PINYIN_Iu, SCIM_PINYIN_ZeroFinal }, // Q
{ SCIM_PINYIN_Uan, SCIM_PINYIN_Er }, // R
{ SCIM_PINYIN_Ong, SCIM_PINYIN_Iong }, // S
{ SCIM_PINYIN_Ue, SCIM_PINYIN_ZeroFinal }, // T
{ SCIM_PINYIN_U, SCIM_PINYIN_ZeroFinal }, // U
{ SCIM_PINYIN_V, SCIM_PINYIN_Ui }, // V
{ SCIM_PINYIN_Ia, SCIM_PINYIN_Ua }, // W
{ SCIM_PINYIN_Ie, SCIM_PINYIN_ZeroFinal }, // X
{ SCIM_PINYIN_Uai, SCIM_PINYIN_V }, // Y
{ SCIM_PINYIN_Ei, SCIM_PINYIN_ZeroFinal }, // Z
{ SCIM_PINYIN_Ing, SCIM_PINYIN_ZeroFinal }, // ;
};




static const PinyinInitial scim_shuang_pin_ziguang_initial_map [] =
{
SCIM_PINYIN_Chi, // A
SCIM_PINYIN_Bo, // B
SCIM_PINYIN_Ci, // C
SCIM_PINYIN_De, // D
SCIM_PINYIN_ZeroInitial, // E
SCIM_PINYIN_Fo, // F
SCIM_PINYIN_Ge, // G
SCIM_PINYIN_He, // H
SCIM_PINYIN_Shi, // I
SCIM_PINYIN_Ji, // J
SCIM_PINYIN_Ke, // K
SCIM_PINYIN_Le, // L
SCIM_PINYIN_Mo, // M
SCIM_PINYIN_Ne, // N
SCIM_PINYIN_ZeroInitial, // O
SCIM_PINYIN_Po, // P
SCIM_PINYIN_Qi, // Q
SCIM_PINYIN_Ri, // R
SCIM_PINYIN_Si, // S
SCIM_PINYIN_Te, // T
SCIM_PINYIN_Zhi, // U
SCIM_PINYIN_ZeroInitial, // V
SCIM_PINYIN_Wo, // W
SCIM_PINYIN_Xi, // X
SCIM_PINYIN_Yi, // Y
SCIM_PINYIN_Zi, // Z
SCIM_PINYIN_ZeroInitial, // ;
};


static const PinyinFinal scim_shuang_pin_ziguang_final_map [][2] =
{
{ SCIM_PINYIN_A, SCIM_PINYIN_ZeroFinal }, // A
{ SCIM_PINYIN_Iao, SCIM_PINYIN_ZeroFinal }, // B
{ SCIM_PINYIN_Ing, SCIM_PINYIN_ZeroFinal }, // C
{ SCIM_PINYIN_Ie, SCIM_PINYIN_ZeroFinal }, // D
{ SCIM_PINYIN_E, SCIM_PINYIN_ZeroFinal }, // E
{ SCIM_PINYIN_Ian, SCIM_PINYIN_ZeroFinal }, // F
{ SCIM_PINYIN_Uang,SCIM_PINYIN_Iang }, // G
{ SCIM_PINYIN_Ong, SCIM_PINYIN_Iong }, // H
{ SCIM_PINYIN_I, SCIM_PINYIN_ZeroFinal }, // I
{ SCIM_PINYIN_Iu, SCIM_PINYIN_Er }, // J
{ SCIM_PINYIN_Ei, SCIM_PINYIN_ZeroFinal }, // K
{ SCIM_PINYIN_Uan, SCIM_PINYIN_ZeroFinal }, // L
{ SCIM_PINYIN_Un, SCIM_PINYIN_ZeroFinal }, // M
{ SCIM_PINYIN_Ui, SCIM_PINYIN_Ue }, // N
{ SCIM_PINYIN_Uo, SCIM_PINYIN_O }, // O
{ SCIM_PINYIN_Ai, SCIM_PINYIN_ZeroFinal }, // P
{ SCIM_PINYIN_Ao, SCIM_PINYIN_ZeroFinal }, // Q
{ SCIM_PINYIN_An, SCIM_PINYIN_ZeroFinal }, // R
{ SCIM_PINYIN_Ang, SCIM_PINYIN_ZeroFinal }, // S
{ SCIM_PINYIN_Ng, SCIM_PINYIN_Eng }, // T
{ SCIM_PINYIN_U, SCIM_PINYIN_ZeroFinal }, // U
{ SCIM_PINYIN_V, SCIM_PINYIN_ZeroFinal }, // V
{ SCIM_PINYIN_En, SCIM_PINYIN_ZeroFinal }, // W
{ SCIM_PINYIN_Ia, SCIM_PINYIN_Ua }, // X
{ SCIM_PINYIN_In, SCIM_PINYIN_Uai }, // Y
{ SCIM_PINYIN_Ou, SCIM_PINYIN_ZeroFinal }, // Z
{ SCIM_PINYIN_ZeroFinal, SCIM_PINYIN_ZeroFinal }, // ;
};




static const PinyinInitial scim_shuang_pin_abc_initial_map [] =
{
SCIM_PINYIN_Zhi, // A
SCIM_PINYIN_Bo, // B
SCIM_PINYIN_Ci, // C
SCIM_PINYIN_De, // D
SCIM_PINYIN_Chi, // E
SCIM_PINYIN_Fo, // F
SCIM_PINYIN_Ge, // G
SCIM_PINYIN_He, // H
SCIM_PINYIN_ZeroInitial, // I
SCIM_PINYIN_Ji, // J
SCIM_PINYIN_Ke, // K
SCIM_PINYIN_Le, // L
SCIM_PINYIN_Mo, // M
SCIM_PINYIN_Ne, // N
SCIM_PINYIN_ZeroInitial, // O
SCIM_PINYIN_Po, // P
SCIM_PINYIN_Qi, // Q
SCIM_PINYIN_Ri, // R
SCIM_PINYIN_Si, // S
SCIM_PINYIN_Te, // T
SCIM_PINYIN_ZeroInitial, // U
SCIM_PINYIN_Shi, // V
SCIM_PINYIN_Wo, // W
SCIM_PINYIN_Xi, // X
SCIM_PINYIN_Yi, // Y
SCIM_PINYIN_Zi, // Z
SCIM_PINYIN_ZeroInitial, // ;
};


static const PinyinFinal scim_shuang_pin_abc_final_map [][2] =
{
{ SCIM_PINYIN_A, SCIM_PINYIN_ZeroFinal }, // A
{ SCIM_PINYIN_Ou, SCIM_PINYIN_ZeroFinal }, // B
{ SCIM_PINYIN_In, SCIM_PINYIN_Uai }, // C
{ SCIM_PINYIN_Ia, SCIM_PINYIN_Ua }, // D
{ SCIM_PINYIN_E, SCIM_PINYIN_ZeroFinal }, // E
{ SCIM_PINYIN_En, SCIM_PINYIN_ZeroFinal }, // F
{ SCIM_PINYIN_Ng, SCIM_PINYIN_Eng }, // G
{ SCIM_PINYIN_Ang, SCIM_PINYIN_ZeroFinal }, // H
{ SCIM_PINYIN_I, SCIM_PINYIN_ZeroFinal }, // I
{ SCIM_PINYIN_An, SCIM_PINYIN_ZeroFinal }, // J
{ SCIM_PINYIN_Ao, SCIM_PINYIN_ZeroFinal }, // K
{ SCIM_PINYIN_Ai, SCIM_PINYIN_ZeroFinal }, // L
{ SCIM_PINYIN_Ui, SCIM_PINYIN_Ue }, // M
{ SCIM_PINYIN_Un, SCIM_PINYIN_ZeroFinal }, // N
{ SCIM_PINYIN_Uo, SCIM_PINYIN_O }, // O
{ SCIM_PINYIN_Uan, SCIM_PINYIN_ZeroFinal }, // P
{ SCIM_PINYIN_Ei, SCIM_PINYIN_ZeroFinal }, // Q
{ SCIM_PINYIN_Iu, SCIM_PINYIN_Er }, // R
{ SCIM_PINYIN_Ong, SCIM_PINYIN_Iong }, // S
{ SCIM_PINYIN_Uang,SCIM_PINYIN_Iang }, // T
{ SCIM_PINYIN_U, SCIM_PINYIN_ZeroFinal }, // U
{ SCIM_PINYIN_V, SCIM_PINYIN_ZeroFinal }, // V
{ SCIM_PINYIN_Ian, SCIM_PINYIN_ZeroFinal }, // W
{ SCIM_PINYIN_Ie, SCIM_PINYIN_ZeroFinal }, // X
{ SCIM_PINYIN_Ing, SCIM_PINYIN_ZeroFinal }, // Y
{ SCIM_PINYIN_Iao, SCIM_PINYIN_ZeroFinal }, // Z
{ SCIM_PINYIN_ZeroFinal, SCIM_PINYIN_ZeroFinal }, // ;
};




static const PinyinInitial scim_shuang_pin_liushi_initial_map [] =
{
SCIM_PINYIN_ZeroInitial, // A
SCIM_PINYIN_Bo, // B
SCIM_PINYIN_Ci, // C
SCIM_PINYIN_De, // D
SCIM_PINYIN_ZeroInitial, // E
SCIM_PINYIN_Fo, // F
SCIM_PINYIN_Ge, // G
SCIM_PINYIN_He, // H
SCIM_PINYIN_Chi, // I
SCIM_PINYIN_Ji, // J
SCIM_PINYIN_Ke, // K
SCIM_PINYIN_Le, // L
SCIM_PINYIN_Mo, // M
SCIM_PINYIN_Ne, // N
SCIM_PINYIN_ZeroInitial, // O
SCIM_PINYIN_Po, // P
SCIM_PINYIN_Qi, // Q
SCIM_PINYIN_Ri, // R
SCIM_PINYIN_Si, // S
SCIM_PINYIN_Te, // T
SCIM_PINYIN_Shi, // U
SCIM_PINYIN_Zhi, // V
SCIM_PINYIN_Wo, // W
SCIM_PINYIN_Xi, // X
SCIM_PINYIN_Yi, // Y
SCIM_PINYIN_Zi, // Z
SCIM_PINYIN_ZeroInitial, // ;
};


static const PinyinFinal scim_shuang_pin_liushi_final_map [][2] =
{
{ SCIM_PINYIN_A, SCIM_PINYIN_ZeroFinal }, // A
{ SCIM_PINYIN_Ao, SCIM_PINYIN_ZeroFinal }, // B
{ SCIM_PINYIN_Ang, SCIM_PINYIN_ZeroFinal }, // C
{ SCIM_PINYIN_Uan, SCIM_PINYIN_ZeroFinal }, // D
{ SCIM_PINYIN_E, SCIM_PINYIN_ZeroFinal }, // E
{ SCIM_PINYIN_An, SCIM_PINYIN_ZeroFinal }, // F
{ SCIM_PINYIN_Ong, SCIM_PINYIN_Iong }, // G
{ SCIM_PINYIN_Ui, SCIM_PINYIN_Ue }, // H
{ SCIM_PINYIN_I, SCIM_PINYIN_ZeroFinal }, // I
{ SCIM_PINYIN_Ia, SCIM_PINYIN_Ua }, // J
{ SCIM_PINYIN_Un, SCIM_PINYIN_ZeroFinal }, // K
{ SCIM_PINYIN_Iu, SCIM_PINYIN_ZeroFinal }, // L
{ SCIM_PINYIN_In, SCIM_PINYIN_ZeroFinal }, // M
{ SCIM_PINYIN_Uang,SCIM_PINYIN_Iang }, // N
{ SCIM_PINYIN_Uo, SCIM_PINYIN_O }, // O
{ SCIM_PINYIN_Ng, SCIM_PINYIN_Eng }, // P
{ SCIM_PINYIN_Ing, SCIM_PINYIN_ZeroFinal }, // Q
{ SCIM_PINYIN_Ou, SCIM_PINYIN_Er }, // R
{ SCIM_PINYIN_Ai, SCIM_PINYIN_ZeroFinal }, // S
{ SCIM_PINYIN_Ian, SCIM_PINYIN_ZeroFinal }, // T
{ SCIM_PINYIN_U, SCIM_PINYIN_ZeroFinal }, // U
{ SCIM_PINYIN_V, SCIM_PINYIN_En }, // V
{ SCIM_PINYIN_Ei, SCIM_PINYIN_ZeroFinal }, // W
{ SCIM_PINYIN_Ie, SCIM_PINYIN_ZeroFinal }, // X
{ SCIM_PINYIN_Uai, SCIM_PINYIN_ZeroFinal }, // Y
{ SCIM_PINYIN_Iao, SCIM_PINYIN_ZeroFinal }, // Z
{ SCIM_PINYIN_ZeroFinal, SCIM_PINYIN_ZeroFinal }, // ;
};


Explanation :

Each shuangpin layout uses two structures, one for onset consonnants - ...initial_map - and one for vocal part - ...final_map.

It seems that the position of a pinyin phonetic constant inside the structure determines which kerboard letter it is associated to.
For example :

With the first method, shuang pin stone, I would enter hao, 好by typing "hd" to get the "h" onset consonant and then the "d" would actually represent the vocal part "ao".
See where is placed field SCIM_PINYIN_He in scim_shuang_pin_stone_initial_map, and where is placed field SCIM_PINYIN_Ao in scim_shuang_pin_stone_final_map.

No comments:

Post a Comment