C    Setting Up and Using the Chinese Phrase Input Method

When entering Chinese text, users have the option of entering individual characters and words or a string that identifies a phrase. Chinese phrase input is supported by a phrase database and one of the following:

The phrase utility allows you to create and maintain a phrase database and, when using the VT382-D terminal, to load the database to the terminal.

Table C-1 lists and describes basic terms associated with phrase input.

Table C-1:  Chinese Phrase Input Definitions

Term Description
phrase The string for the phrase that the user wants to retrieve. Each phrase is a string of any characters in the codeset of the current locale and can be a maximum of 80 bytes in length.
phrase code The keyword entered by the user to retrieve a phrase. Each phrase code is a string of up to 8 ASCII alphanumeric characters.
class A group of logically related phrases. Each class has an identifier that is a string of up to 8 ASCII characters.
database

A set of two files: the phrase data file phrase.dat and the class data file class.dat. If a phrase database is moved from one directory to another, the two data files must be moved together.

There are two types of phrase databases: system and user. The system database is shared by all users on the system and is maintained by the system administrator. User databases are defined and maintained by individual users.

Pathnames for the system and user phrase database directories are set in the /var/i18n/conf/cp_dirs file, which is described in Section 6.8. By default, this file sets the pathname for the system phrase database directory to be /var/i18n/sim and for the user phrase database directory to be $HOME/.sim.

Phrase database files are locale specific and reside in locale directories subordinate to the default path. For example, an individual user might create and maintain the following sets of files to support two different locales:

$HOME/.sim/zh_TW.big5/phrase.dat
$HOME/.sim/zh_TW.big5/class.dat
$HOME/.sim/zh_TW.dechanyu/phrase.dat
$HOME/.sim/zh_TW.dechanyu/class.dat

C.1    Enabling the SIM Service

Table C-2 lists and describes the stty command options that enable and set certain characteristics for Chinese phrase input through the VT382 series of Asian terminals. These options do not apply to terminal emulation windows, for which phrase input is supported using mechanisms other than SIM.

Table C-2:  The stty Options Used for the SIM Service

stty Option Description
sim Enables the SIM service.
-sim Disables the SIM service.
simkey key Sets the toggle key for entering phrase input mode.
simclass class Sets the current class name for locating the appropriate phrase in the phrase database. Classes identify subsets of information in the phrase database and are defined by using the phrase utility.
simdb path Sets the path for the phrase database.
simall Displays current SIM service settings.

C.2    Creating and Maintaining a Chinese Phrase Database

You can create or maintain a phrase database by using the phrase utility. On workstations, you invoke this utility with the following command:


% phrase

The command assumes that you are using a private phrase database if you are a nonprivileged user and the systemwide phrase database if you are superuser. You can change these defaults by using the utility's menu interface.

If you are working on a VT382-D traditional Chinese terminal, you can include one of the options described in Table C-3. These options allow you to use the hardware phrase input method supported by your terminal.

Table C-3:  The phrase Options for the VT382-D Terminal

phrase Option Description
-user class_name Downloads the phrase definitions for the specified class from your private phrase database to the terminal.
-system class_name Downloads the phrase definitions for the specified class from the systemwide phrase database to the terminal.

On startup, the phrase utility displays a full-screen, menu-driven interface like the one in Figure C-1.

Figure C-1:  User Interface Screen of the phrase Utility

Take the following steps to change the language of messages and other text on the user interface to English:

  1. Press the L key.

    This action displays items on the LANGUAGE menu.

  2. Press the E key.

    This action specifies English for the user interface.

The phrase utility is a curses application. To navigate the phrase utility user interface, use the following guidelines:

The phrase user interface screen includes:

The different menus allow you to perform the following operations:

The following guidelines and restrictions apply to the phrase-management operations that you can perform:

C.3    Using a Chinese Phrase Database

How you use a phrase database depends on whether you are using the hardware input method or the SIM service. You can use either the hardware input method or SIM service on a VT382D Traditional Chinese terminal. For other terminals in the VT382 series of Asian terminals or for a terminal emulation window on a workstation, you use the SIM service.

If you are using the hardware input method with a VT382D Traditional Chinese terminal, refer to your terminal user guide for phrase input instructions.

C.3.1    Phrase Input Supported Through the SIM Service

ž x location: e Ÿ Before you can use a phrase database, you use the stty command to:

If you do not want to use phrases from the class DEFAULT or from your default phrase database, use the stty command to:

When the terminal setup is complete, you can perform the following actions to retrieve a phrase:

  1. Press the key sequence specified for the simkey option of the stty command, for example Ctrl-b.

    At the bottom of your screen, you are prompted to enter a phrase code.

  2. Type the phrase code and press either Return or the space bar.

    The phrase is returned to the screen or, if the phrase code was not found, an error message is displayed.

When you want to exit from phrase input mode, press the simkey key sequence again.

While in phrase input mode, the characters that you enter are subject to the following rules:

C.3.2    Phrase Input from the Input Options Application

When phrase input is supported by your language setting and the associated input method server is running, your desktop environment includes an Input Options window. Click on the Options button in this window to: