Simplified Chinese Solaris User's Guide

Introduction

The Simplified Chinese Solaris software provides code table interface for adding new input methods. In a plain text file, you can create a list Chinese words or phrases along with the key strokes you have selected to create them.

Creating a Code Table

  1. Create and edit code table source file:

    Prepare the code table source file to present the new input method. You need to list characters, words, or phrases and the corresponding key strokes required to create them. Each row defines the mapping between one Chinese word and its input key stroke. The file format is:


    #
    # Comment
    #
    <code_table>
    [word	  keystroke-sequence]
    

    See the following example:

    Graphic
  2. Convert code table:

    The source code table needs to be converted to binary form for Chinese Solaris language engine. This can be done by the code table converter: mkcodetab. The converter can take several source code table files and converter into a binary code table file. If -o is not used, the output will be send to system standard out.

    The command syntax is:


    # mkcodetab source_code_table_files [-o binary_code_table_file]
    

    See the following two examples:


    # mkcodetab wubi.txt -o wubi.ct
    # mkcodetab < wubi.txt > wubi.ct
    

    Both forms do the same function: convert the source code table wubi.txt into the binary code table wubi.ct. The following command converts multisource code table files into one binary code table file:


    # mkcodetab wubi1.txt wubi2.txt wubi3.txt > wubi.ct
    
  3. Create a dictionary file (optional).

    Specifying a dictionary file allows you to add a linking or associating function to an input method. Thus, when the user types a Chinese character, all the words associated with it in the dictionary will be shown for selecting.

    The dictionary file is a plain text file that contains the words user wants to have associated. The words are separated by space. For example:


    word1 word2 word3
    word4 word5
    word6 word7 word8 word9
    ... ... ...
    
  4. Add the code table into the input method specification file.

    After code table is ready, the input method can be added to the system by updating input method specification file:

    /usr/lib/mle/zh/data/keybind.dat

    The keybind.dat file requires the following information:

    • Input method name

    • Function key and control key to turn on the input method

    • Code table (binary) file name

    • Key to show previous selection screen

    • Key to show the next selection screen

    • Wild char definition

    • Key to commit the first candidate in the selection

    Once keybind.dat is updated, the Simplified Chinese Solaris operating environment can interpret the input method. This information is added to keybind.dat in the following format:


    % input_method_name: control_key:function_key:display_message
    		key_word = definition
    

    See the following example:

    Graphic

    Table 5-1 Elements in keybind.dat File

    key_word

    Definition 

    CT:

    Code Table file name 

    PG:

    Key to display previous group of selections 

    NG:

    Key to display next group of selections 

    FC:

    Key to commit the first (matched) character 

    WC:

    Wild Character to match any key in input keystroke. The matched selections will be shown. 

    DS:

    Key to display all selections (not needed if WC is defined). 

    DICT:

    Dictionary file name 

    PROPS:

    If AUTO_POPUP is defined, the selections will be automatically shown while any keystroke is typed. The DS definition is not needed). One example to use this is Pinyin input method.

    Edit the system keybind file, /usr/lib/mle/zh/data/keybind.dat, if you want to make the new input method available for all users on this system. If you just want to do so for your own environment, you can set the KEYBIND environmental variable:


    % setenv KEYBIND your_keybind_file
    
  5. Add a new line in /usr/openwin/lib/locale/zh/xim/hotkey.dat, as shown in the following example:


    **** hotkey.dat ****
     
    @BEGIN_USER
    #Hot Key						engine_name								method_table_name
    #F8 for NewPY, the default IM
    F8						cm								cm
    F11						shuangpy								cm
    @END_USER
    @BEGIN_SYSTEM
     
    ####### All of the following hotkeys should be in the others.so.
     
    #Hot Key						engine_name								method_table_name
    #Hot Key for "location" method.
    F2						others								cm
    #Hot Key for "py" method.
    F3						others								cm
    #Hot Key for "Stroke" method.
    F4						others								cm
    #Hot Key for "full py" method.
    F5						others								cm
    #Hot Key for "Golden" method.
    F6						others								cm
    #Add a new IM by user, Hot key for "Wubi" method.
    F10						others								cm
    #Hot Key for "Chinese Symbol" method.
    F12						others								cm
    @END_SYSTEM
  6. Restart the input method server (htt) so that your new input method can be recognized.

    For the above example, the F10 function key will turn on the new input method.

    Your new input method is ready to use.