B    Phrase Utility

When entering Chinese or Korean text, you have the option of entering individual characters and words or a string that identifies a phrase. The operating system supports phrase input in the following ways:

This appendix describes the operating system Phrase Utility used by dxhanyuim, dxhanziim, and dxhangulim and includes information on creating and using a phrase database. See the dxim Input Server online help for information on creating and using a phrase database with the dxim Phrase Input Method.

The Chinese and Korean Input Servers support phrase input by means of a phrase database and one of the following:

Using the Chinese and Korean input method servers, you can enter individual phrases and their codes for conversion and reuse as described in the Technical Reference manuals for those languages. You can also use the Phrase Utility to create and maintain a phrase database as described in this appendix.

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

Table B-1:  Phrase Input Definitions

Term Description
Phrase The string for the phrase that you want 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 that you enter 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. 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. See the Writing Software for the International Market manual for more information on the cp_dirs file.

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

B.1    Enabling the SIM Service

Table B-2 describes the stty command options that enable and set certain characteristics for Chinese phrase input through traditional and simplified Chinese terminals. These options do not apply to terminal emulation windows, which use mechanisms other than SIM and support Chinese and Korean Input Server phrase input.

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

stty Option Description
sim Enables the SIM service.
-sim Disables the SIM service.
simall Displays current SIM service settings.
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.
simkey key Sets the toggle key for entering phrase input mode.
simmode dmode Sets the display location for the phrase. The two supported settings are offspot (the default) and onspot. Use onspot with terminal emulators, such as xterm and dxterm, that do not support the 26th display line.

B.2    Creating and Maintaining a 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

If you are a nonprivileged user, the phrase command assumes that you are using a private phrase database. If you are superuser, the phrase command assumes that you are using the system-wide phrase database. You can change these defaults by using the Phrase Utility Menu interface.

On startup, the Phrase Utility displays a full-screen, menu-driven interface. (Figure B-1 illustrates the display as it would appear on an Asian language system.)

Figure B-1:  User Interface Screen of the Phrase Utility

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

The Phrase Utility screen includes the following:

The following list describes the Phrase Utility menus and the operations they perform. The list is followed by guidelines and restrictions on the use of these menus.

The following guidelines and restrictions apply to the use of the Phrase Utility:

B.3    Using a Phrase Database

How you use a phrase database depends on whether you are using the hardware input method or the SIM service.

B.3.1    Phrase Input Supported Through the SIM Service

You use the SIM service on the traditional and simplified Chinese terminals or in a terminal emulation window on a workstation.

Before you can use a phrase database through SIM service, you must use the stty command to perform the following tasks:

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

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 the Return key 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:

B.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 perform the following tasks: