1 2 ***************************************** 3 * Chapter 4 COMMANDS * 4 ***************************************** 5 6 7 8 9 4.1 OVERVIEW 10 ============ 11 12This chapter gives a description of the cWnn commands and other utilities available. 13 14 cWnn Commands : 15 ~~~~~~~~~~~~~ 16 1. cserver - The startup of the server 17 2. cuum - The startup of the front-end client 18 3. cwnnkill - The termination of the server 19 4. cwnnstat - The current usage status of the server 20 21 cWnn Utilities : 22 ~~~~~~~~~~~~~~ 23 5. catod - The creation of the binary form of a dictionary 24 6. cdtoa - The restoration of a dictionary to its text form 25 7. catof - The creation of the binary form of a grammar file 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 - 4-1 - 51 52 4.2 cserver - THE STARTUP OF THE SERVER 53 ======================================= 54 55 * Description 56 cserver - The multi-user Chinese server. 57 58 * Standard path 59 /usr/local/bin/cWnn4/cserver 60 61 * Command format 62 cserver [-f file] [-s file] 63 64 * Function 65 cserver provides the services and resources required by the users (clients) 66 during the conversion. 67 The input environment is provided by the front-end processor (uum), which 68 sends the conversion request to the cserver, which subsequently performs the 69 service. 70 71 Normally, once the system is up, fork() will be executed and the server runs as 72 background process. 73 The startup of cserver can be set in "/etc/rc" to be executed automatically in 74 the Unix system. 75 76 When the cserver command is executed, all the files defined in 77 "/usr/local/lib/wnn/zh_CN/cserverrc" will be read and the appropriate operations will 78 be performed. 79 Besides, all dictionaries and usage frequency files of the clients will be 80 maintained by the cserver. Please refer to section 5.2 for more details. 81 82 * Function options 83 -f file -- "file" will be set as the initialization file, which replaces the 84 default cserverrc. 85 86 -s file -- "file" will be set as the logfile of cserver. 87 When "file" is defined as "-", the logfile will be sent to the 88 standard error output. 89 90 * Related files 91 /tmp/cd_sockV1 92 /tmp/CSERVER.EXIST 93 94 * Reference 95 cserverrc(5.2) 96 97 98 99 100 - 4-2 - 101 102 4.3 cuum - THE STARTUP OF THE CLIENT 103 ===================================== 104 105 * Description 106 cuum, - The execution of the Chinese input front-end processor. 107 108 * Standard path 109 /usr/local/bin/cWnn4/cuum 110 111 * Command format 112 cuum[-h/H] [-x/X] 113 [-k uumkey_file] [-c convert_key_file] 114 [-r auto_file] [-D server_hostname] 115 [-n username] [-l number of lines for conversion input] 116 [-L lang] 117 118 * Function description 119 The default input automaton definition directory is 120 "/usr/local/lib/wnn/zh_CN/rk/". 121 122 Once cuum is executed, the initialization file is searched in the following 123 order : 124 (1) The file specified by the UUMRC C-Shell environment variable. 125 (2) @HOME/.uumrc 126 (3) /usr/local/lib/wnn/zh_CN/uumrc (standard path) 127 128 The communication between cuum and cserver is via the socket where cuum 129 sends a conversion request to the cserver, which will perform the conversion 130 request and pass the result back to cuum. 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 - 4-3 - 151 * Function options 152 -H The input mode will be set to ON after the startup of cuum. 153 154 -h The input mode will be set to OFF after the startup of cuum(default). 155 156 -X During cuum startup, the flow control of tty is ON (default). 157 158 -x During cuum startup, the flow control of tty is OFF. 159 160 -k uumkey_file 161 Set the key code definition file. By default, it is searched in the 162 following order : 163 (1) The filename indicated by setuumkey in the uumrc initialization 164 file. 165 (2) /usr/local/lib/wnn/zh_CN/uumkey 166 167 -c convert_key_file 168 Set the key code conversion file. By default, it is searched in the 169 following order : 170 (1) The filename indicated by setconvkey in the uumrc initialization 171 file. 172 (2) /usr/local/lib/wnn/cvt_key_tbl 173 174 -r auto_file 175 Set the input mode definition file of the input automaton. 176 By default, it is searched in the following order : 177 (1) The filename indicated by setautofile in the uumrc 178 initialization file. 179 (2) /usr/local/lib/wnn/zh_CN/rk/mode 180 181 -l lines 182 Indicates the number of lines for the Chinese input operation. 183 (0 < lines < window line-1). The default value is 1. 184 185 -D server_hostname 186 The user can select the server from another host by using this 187 option. If no hostname is specified, the one specified by the 188 environment variable CSERVER will be used. 189 Each environment of the client can be set by defining in the 190 "setconvenv" initialization file. 191 192 -n username 193 Indicates the username for the client. The value in environment 194 variable CWNNUSER will be taken as the default value. If CWNNUSER 195 is not defined, the username of the current client will be taken. 196 197 -L lang 198 Indecates the language. 199 For chinese zh_CN, for japanese ja_JP. 200 - 4-4 - 201 * Note 202 During the startup of cuum, a "pty" is required from the operating system. 203 If "pty" is unable to be obtained, cuum startup will fail. 204 Similarly, if the initialization file, input automaton definition files and 205 key code definition file are not read in, cuum startup will also fail. 206 207 * Reference 208 cserver(4.2) uumrc(5.3) uumkey(5.6) 209 cvt_key_tbl(5.7) romkan(6) 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 - 4-5 - 251 252 4.4 cwnnstat - REPORT THE CURRENT STATUS OF THE SERVER 253 ====================================================== 254 255 * Description 256 cwnnstat - To show the current status of cserver. 257 258 * Standard path 259 /usr/local/bin/cWnn4/cwnnstat 260 261 * Command format 262 cwnnstat [-w] [-e] [-E] [-f] [-F] [-d] [-D] [-L lang] [hostname] 263 264 * Function 265 To request for the current execution status of the server for the current host 266 or another machine given the hostname. 267 With the function options as shown below, different information can be obtained. 268 269 * Function options 270 -w List username, hostname, socket number and the environment number. 271 272 -e List environment number, environment name and reference count. 273 274 -E List environment number, environment name, reference count, grammatical 275 file number, dictionary file number and the filenames. 276 277 -f List file id of each cWnn file in the server, the file type, location of 278 file, reference count and filename. 279 280 -F Same as -f 281 282 -d List dictionary number, type, file number, filename and usage frequency 283 filename of the dictionaries. 284 285 -D List dictionary number, type, conversion method, number of entries, 286 static/dynamic, current usage status, priority, alias, file name, 287 [(alias:usage frequency filename)], [password (frequency password)] 288 of the dictionaries. 289 290 -L lang 291 Indecates the language. 292 For Simplified Chinese zh_CN, for Traditional Chinese zh_TW. 293 * Note 294 Dictionary number is different from file number. 295 File number refers to the standardized number among cWnn files. 296 Dictionary number refers to the logical dictionary number in the server. 297 One dictionary may consist of different usage frequency files. 298 Different conversion methods make use of different dictionaries. 299 300 - 4-6 - 301 302 4.5 cwnnkill - THE SERVER TERMINATION 303 ===================================== 304 305 * Description 306 cwnnkill - The termintation of cserver. 307 308 * Standard path 309 /usr/local/bin/cWnn4/cwnnkill 310 311 * Command format 312 cwnnkill [-L lang] [hostname] 313 314 * Function 315 To terminate the cserver of the current machine or the specified hostname 316 (other machine). 317 If hostname is specified, cwnnkill will terminate the server for that 318 particular hostname. 319 If some client still exists on the server of the stated host, the 320 termination will fail. 321 322 -L lang 323 Indecates the language. 324 For Simplified Chinese zh_CN, for Traditional Chinese zh_TW. 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 - 4-7 - 351 352 4.6 catod - DICTIONARY CREATION 353 ============================== 354 355 * Description 356 catod - To convert the text format of dictionary to binary format. 357 358 * Standard path 359 /usr/local/bin/cWnn4/catod 360 361 * Command format 362 catod [filename] 363 364 * Function 365 This command converts a dictionary text file into binary format. 366 367 * Function options 368 -b To convert the dictionary for encoded (Bianma) input. 369 370 -c To convert the dictionary for Pinyin/Zhuyin-Hanzi conversion. 371 372 * Note 373 Two atod's are available : 374 (1) atod_py (for Pinyin) 375 (2) atod_zy (for Zhuyin) 376 Options -p and -z can be used respectively. 377 The option -c is taken as default. 378 379 * Reference 380 cdtoa(4.7) 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 - 4-8 - 401 402 4.7 cdtoa - CONVERSION OF BINARY DICTIONARY INTO TEXT FORMAT 403 =========================================================== 404 405 * Description 406 cdtoa - To convert the binary form of dictionary back to text form. 407 408 * Standard path 409 /usr/local/bin/cWnn4/cdtoa 410 411 * Command format 412 cdtoa [-n] [-s] < filename> [< usage frequency filename> ....] 413 414 * Function 415 To convert the binary form of the dictionary to text form, and output to 416 standard output. 417 The second parameter can indicate more than one user usage frequency file 418 (for a particular user), which will be reflected in the text form of the 419 dictionary. 420 421 * Function options 422 -s Order the entries in text dictionary according to pronunciation. 423 424 -n Attach sequence numbers to the output. 425 426 * Note 427 Two dtoa's are available : 428 (1) dtoa_py (for Pinyin) 429 (2) dtoa_zy (for Zhuyin) 430 Options -p and -z can be used respectively. 431 The Pinyin and Zhuyin dictionary has the same format. 432 By using atod and dtoa, user can convert between Pinyin and Zhuyin 433 dictionaries. 434 435 * Reference 436 catod(4.6) 437 438 439 440 441 442 443 444 445 446 447 448 449 450 - 4-9 - 451 452 4.8 atof - FREQUENCY FILE CREATION 453 ================================== 454 455 * Description 456 catof - To convert the text form of grammatical rules into binary format. 457 458 * Standard path 459 /usr/local/bin/cWnn4/catof 460 461 * Command format 462 catof [filename] 463 464 * Function 465 This command converts a text file of grammatical rules into binary format. 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 - 4-10 - 501