Example: Inputting a simple Chinese phrase with pinyin

Xiaoming is a Chinese programmer. He is going to write a "Hello world" program that prints this message in Chinese, too.

Xiaoming lives in Mainland China. He has learned Pinyin and Simplified Chinese since primary school. Hence he is going to input with a Pinyin input method.

He will show us Chinese inputting with Microsoft Windows and Google Pinyin because his favorite Fedora GNU/Linux distribution switched to GNOME3 + GnomeShell since Fedora 15. Since then the user interface of the input method deviated from what Xiaoming felt comfortable with and Xiaoming really wants the UI to be improved in the future.

(In plain English: The true reason is, Windows+GooglePinyin's UI is more traditional and represents a typical Chinese inputting scenario. Of course GNOME3 can be better than that in the future.)

His keyboard looks like this, a plain English notebook keyboard:

keyboard.jpg

He opens a text editor and quickly types the skeleton:

01.png

He is now going to input some Chinese characters. He hits ctrl+space to activate the input method.

02.png

Now a "bar" appears on the screen. The bar usually resides in the lower-right corner of the screen. It shows the current state of the input method. Currently the state is "inputting Chinese characters", "using half-width letters, numbers and spaces", "using full-width punctuations".

B.T.W. Since he is so used to ctrl+space for activating IM that he hates all IDEs that use ctrl+space for code completion.

He wants to input "世界你好", the Chinese phrase for "hello world". The Pinyin for each character is

  • 世 shi
  • 界 jie
  • 你 ni
  • 好 hao

He first types "shijie" on the keyboard because the two characters "世界" together means "world".

The input method then shows him a list of possible Chinese phrases: "世界", "师姐", "时节", "十届" and "视界", all of which have the same Pinyin "shijie".

03.png

He chooses the first candidate "世界" which means "world" by pressing the key 1. Then "世界" appears before the cursor in the GVim text editor.

04.png

Then he types "nihao" for "你好" which means "hello". The input method, again, gives him several candidates.

05.png

There are only two phrases "你好" and "拟好" in GooglePinyin's dictionary which correspond to "nihao". The rest candidates "你", "拟" and "逆" only correspond to "ni". The input method is smart enough to know "nihao" should be split into "ni" and "hao".

Xiaoming could press 1 to select "你好" which he desires. But since "你好" is the first candidate, he presses the spacebar to select that since the spacebar is easier to press than 1.

Then "你好" is inputted.

06.png

Xiaoming then pressed ctrl+space again to turn off the input method so that he can use GVim's commands.

07.png

Note that the input method "bar" disappeared.

Then he hits the ESC key, then :w, then the ENTER key to save the document.

08.png

Attic/Inputting/Inputting/Chinese/Example/PhrasePinyin (last edited 2013-12-03 18:45:50 by WilliamJonMcCann)