Table of Contents

## Name

tit2cit, cit2tit - Input method compiler for cxterm

## Synopsis

tit2cit [file]
cit2tit [file]

## Description

Input methods for cxterm are stored as external files and are loaded by cxterm in runtime on demand. Input method files have two formats, text format and compiled format.

Text format has suffix .tit (tit for Text Input Table) in the file name, and is intended to be read and written by human; compiled format has suffix .cit (cit for Compiled Input Table) in the file name, and is loaded by cxterm. Utilities tit2cit and cit2tit convert input method files between these two formats.

If the file argument is given to the tit2cit or cit2tit, the input is taken from the file, otherwise the input is from stdin. Both programs write the input table to stdout.

## Tit File Format

A .tit file is a line-oriented text (English and Chinese) file. The whole file contains of two parts, the definition part followed by the dictionary part. All lines begin with leading '#' are ignored. Then each line consists of one keyword and followed by zero or more definitions. In the following formal specification,

<key> means any character with ASCII code from 0 to 127, if not printable, the character should be in \ooo format, where ooo is the ASCII code in 3 octal-decimal digit form;

<keys> means a continuous string of <key>;

<string> means any string of ASCII characters (unprintable in ooo) and Chinese characters;

<Cstring> means string of Chinese characters;

\000 indicates an empty field.

## Definition Part

Each line is consisted of a keyword and followed by optional definitions:

ENCODE: <string>
  Define the encoding of the input method. Valid values of <string> are GB, BIG5, JIS, and KS; the default is GB.
AUTOSELECT: <string>
  Specify whether a Chinese character should be automatically input without a selection key, when it is the only candidate of a given input string. Valid values of <string> are NEVER, ALWAYS, or WHENNOMATCH; the default is NEVER.
PROMPT: <string>
  Define prompt string to be shown in the cxterm input area. Valid values of <string> are any Chinese and English mixed string shorter or equal to 24 bytes. There is no default value for this prompt.
VALIDINPUTKEY: <keys>
  Specify all the valid input keys that can be used in the input string of a Chinese character. There is no default valid input keys.
WILDCARDKEY: <keys>
  Specify the keys for use to match any number of input keys in Chinese input. The default value is "*".
WILDCHARKEY: <keys>
  Specify the keys for use to match any single input key in Chinese input. The default value is "?".
ASSOCIATIONKEY: <keys>
  Specify the keys for use in association phrase input by composition. The default value is "-".
SELECTKEY: <keys> <keys> ...
  Specify the keys to be used in Chinese input selection. They must be in same order of the choices shown on the input area. The number of sets of keys <keys> can not exceed 16. The default value is

          SELECTKEY: 1\040 2 3 4 5 6 7 8 9 0

MOVERIGHT: <keys>
  Specify the keys to be used to show more choices at the right. The default value is ".>"
MOVELEFT: <keys>
  Specify the keys to be used to show more choices at the left. The default value is ",<"
BACKSPACE: <keys>
  Specify the keys to be used for backspace in Chinese input area. The default value is "\010\177" (Backspace, Delete).
DELETEALL: <keys>
  Specify the keys to be used to clear all input in Chinese input area. The default value is "\015\025" (Return, CTRL-U).
CURSOR-BEGIN: <keys>
  Specify the keys to move the cursor to the beginning of the input keystroke buffer. There is no default cursor movement key.
CURSOR-END: <keys>
  Specify the keys to move the cursor to the end of the input keystroke buffer. There is no default cursor movement key.
CURSOR-FORW: <keys>
  Specify the keys to move the cursor forward one key in the input keystroke buffer. There is no default cursor movement key.
CURSOR-BACK: <keys>
  Specify the keys to move the cursor backward one key in the input keystroke buffer. There is no default cursor movement key.
CURSOR-ERASE: <keys>
  Specify the keys to delete the input key at the cursor position. There is no default cursor movement key.
REPEATKEY: <keys>
  Specify the keys to be used to repeat the input of last selection. The default value is "\020\022" (CTRL-P, CTRL-R).
KEYPROMPT(<key>): <string>
  Define corresponding <string> to be displayed in input area when the key <key> is input. Maximum length of each <string> is 4 bytes. Default value of <string> is the <key> itself.
COMMENT anything
  Any thing follows COMMENT will be saved at the end of the .cit file.

## Dictionary Part

The dictionary part contains optional hanzi dictionary and phrase dictionary.

The hanzi dictionary starts with BEGINDICTIONARY. Each lines in the hanzi dictionary is in the form of:

        <keys>    <Cstring>

Each individual Chinese character in <Cstring> can be input by key sequence <keys>.

The phrase dictionary starts with BEGINPHRASE. A phrase is a unit of multiple Chinese characters and is input together as a whole. Each lines in the phrase dictionary is in the form of:

        <keys>    <Cstring> <Cstring> ...

Each <Cstring> can be input by key sequence <keys>.

## Bug

cit2tit is not an exact reverse of tit2cit.

## See Also

cxterm(1) , X(1)

## Copyright

Copyright 1991,1994,1995 Yongguang Zhang.

Table of Contents

- Name
- Synopsis
- Description
- Tit File Format
- Definition Part
- Dictionary Part
- Bug
- See Also
- Copyright