1 /* 2 * $Id: jslib.h,v 2.40.2.1 2000/08/04 05:37:15 kaneda Exp $ 3 */ 4 5 /* 6 WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS 7 8 9 Wnn6 Client Library : 10 (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. 11 (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. 12 13 Wnn Software : 14 (C) Copyright Kyoto University Research Institute for Mathematical Sciences 15 1987, 1988, 1989, 1990, 1991, 1992, 1993 16 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 17 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 18 19 Preamble 20 21 These Wnn6 Client Library--Software License Terms and Conditions 22 (the "License Agreement") shall state the conditions under which you are 23 permitted to copy, distribute or modify the software which can be used 24 to create Wnn6 Client Library (the "Wnn6 Client Library"). The License 25 Agreement can be freely copied and distributed verbatim, however, you 26 shall NOT add, delete or change anything on the License Agreement. 27 28 OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to 29 as "OMRON") jointly developed the Wnn6 Software (development code name 30 is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, 31 OMRON publishes the source code of the Wnn6 Client Library, and OMRON 32 permits anyone to copy, distribute or change the Wnn6 Client Library under 33 the License Agreement. 34 35 Wnn6 Client Library is based on the original version of Wnn developed by 36 Kyoto University Research Institute for Mathematical Sciences (KURIMS), 37 OMRON Corporation and ASTEC Inc. 38 39 Article 1. Definition. 40 41 "Source Code" means the embodiment of the computer code, readable and 42 understandable by a programmer of ordinary skills. It includes related 43 source code level system documentation, comments and procedural code. 44 45 "Object File" means a file, in substantially binary form, which is directly 46 executable by a computer after linking applicable files. 47 48 "Library" means a file, composed of several Object Files, which is directly 49 executable by a computer after linking applicable files. 50 51 "Software" means a set of Source Code including information on its use. 52 53 "Wnn6 Client Library" the computer program, originally supplied by OMRON, 54 which can be used to create Wnn6 Client Library. 55 56 "Executable Module" means a file, created after linking Object Files or 57 Library, which is directly executable by a computer. 58 59 "User" means anyone who uses the Wnn6 Client Library under the License 60 Agreement. 61 62 Article 2. Copyright 63 64 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 65 Client Library, including, without limitation, its copyright. 66 67 2.2 Following words followed by the above copyright notices appear 68 in all supporting documentation of software based on Wnn6 Client Library: 69 70 This software is based on the original version of Wnn6 Client Library 71 developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on 72 the original version of Wnn developed by Kyoto University Research Institute 73 for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. 74 75 Article 3. Grant 76 77 3.1 A User is permitted to make and distribute verbatim copies of 78 the Wnn6 Client Library, including verbatim of copies of the License 79 Agreement, under the License Agreement. 80 81 3.2 A User is permitted to modify the Wnn6 Client Library to create 82 Software ("Modified Software") under the License Agreement. A User 83 is also permitted to make or distribute copies of Modified Software, 84 including verbatim copies of the License Agreement with the following 85 information. Upon modifying the Wnn6 Client Library, a User MUST insert 86 comments--stating the name of the User, the reason for the modifications, 87 the date of the modifications, additional terms and conditions on the 88 part of the modifications if there is any, and potential risks of using 89 the Modified Software if they are known--right after the end of the 90 License Agreement (or the last comment, if comments are inserted already). 91 92 3.3 A User is permitted to create Library or Executable Modules by 93 modifying the Wnn6 Client Library in whole or in part under the License 94 Agreement. A User is also permitted to make or distribute copies of 95 Library or Executable Modules with verbatim copies of the License 96 Agreement under the License Agreement. Upon modifying the Wnn6 Client 97 Library for creating Library or Executable Modules, except for porting 98 a computer, a User MUST add a text file to a package of the Wnn6 Client 99 Library, providing information on the name of the User, the reason for 100 the modifications, the date of the modifications, additional terms and 101 conditions on the part of the modifications if there is any, and potential 102 risks associated with using the modified Wnn6 Client Library, Library or 103 Executable Modules if they are known. 104 105 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole 106 or in part into another Software, although its license terms and 107 conditions may be different from the License Agreement, if such 108 incorporation or use associated with the incorporation does NOT violate 109 the License Agreement. 110 111 Article 4. Warranty 112 113 THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. 114 OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, 115 INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS 116 FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY 117 OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT 118 SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE 119 OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE 120 WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT 121 LIBRARY. 122 123 *************************************************************************** 124 Wnn6 Client Library : 125 (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. 126 (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. 127 128 Wnn Software : 129 (C) Copyright Kyoto University Research Institute for Mathematical Sciences 130 1987, 1988, 1989, 1990, 1991, 1992, 1993 131 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 132 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 133 *************************************************************************** 134 135 Comments on Modifications: 136 */ 137 138 /* Version 4.0 139 */ 140 /* 141 Nihongo Henkan Library Header File 142 */ 143 #ifndef _JSLIB_H_ 144 #define _JSLIB_H_ 145 146 #ifndef _WNN_SETJMP 147 #define _WNN_SETJMP 148 #include <setjmp.h> 149 #endif 150 151 #ifndef w_char 152 #define w_char unsigned short 153 #endif /* w_char */ 154 155 /* ��ü�٥���(�ʻ��ֹ�)����� */ 156 #define WNN_BUN_SENTOU -1 /* ��ʸ�����Ƭ�ˤʤ���� */ 157 #define WNN_ALL_HINSI -2 /* �ʤ�Ǥ⤨���� */ 158 /* ��ü�٥�������� */ 159 #define WNN_VECT_KANREN 0 /* Ϣʸ���Ѵ��ν�ü�٥����� */ 160 #define WNN_VECT_KANTAN 1 /* ñʸ���Ѵ��ν�ü�٥����� */ 161 #define WNN_VECT_KANZEN 1 /* �������Ф��ν�ü�٥����� 162 ñʸ���Ѵ����Τ�Τ���������*/ 163 #define WNN_VECT_BUNSETSU 2 /* Ϣʸ���Ѵ����Ρ���ʸ��ν�ü�٥�����*/ 164 #define WNN_VECT_NO -1 /* ��ü�٥���1 ̵�� */ 165 /* ʸ��ν�ü����³���� */ 166 #define WNN_CONNECT_BK 1 /* ���ꤵ�줿��ü�٥���������³�Ǥ�����*/ 167 #define WNN_NOT_CONNECT_BK 0 /* */ 168 /* ʸ�����ü����³���� */ 169 #define WNN_CONNECT 1 /* ���ꤵ�줿(�ʻ졢��°��)����³�Ǥ�����*/ 170 #define WNN_SENTOU 2 /* ��ʸ�����Ƭ */ 171 #define WNN_NOT_CONNECT 3 /* ��Ƭ�ˤʤ�ʤ�����������³�Ǥ��ʤ� */ 172 #define WNN_GIJI 4 /* ����ʸ����ä���*/ 173 174 /* ����ʸ���ľ������������ */ 175 #define WNN_HIRAGANA -1 /* �Ҥ餬�� *//* �ɤߤΤޤ� */ 176 #define WNN_KATAKANA -11 /* �������� */ 177 #define WNN_IKEIJI_ENTRY -50 /* �۷��� */ 178 /* ���� */ 179 #define WNN_NUM_HAN -2 /* Ⱦ�ѿ��� *//* �ɤߤΤޤ� */ 180 #define WNN_NUM_ZEN -12 /* ���ѿ��� *//* ������ */ 181 #define WNN_NUM_KAN -13 /* ������ *//* ���� */ 182 #define WNN_NUM_KANSUUJI -15 /* ������ *//* ɴ�� */ 183 #define WNN_NUM_KANOLD -16 /* ������ *//* ��ɴ������ */ 184 #define WNN_NUM_HANCAN -17 /* Ⱦ�ѿ��� *//* 1,234 */ 185 #define WNN_NUM_ZENCAN -18 /* ���ѿ��� *//* ���������� */ 186 /* �ѿ� */ 187 #define WNN_ALP_HAN -4 /* Ⱦ�� *//* �ɤߤΤޤ� */ 188 #define WNN_ALP_ZEN -30 /* ���� */ 189 /* ���� */ 190 #define WNN_KIG_HAN -5 /* Ⱦ�� *//* �ɤߤΤޤ� */ 191 #define WNN_KIG_JIS -40 /* ����(JIS) */ 192 #define WNN_KIG_ASC -41 /* ����(ASC) */ 193 /* ������ */ 194 #define WNN_OKURI_REGULATION -1 /* ��§ */ 195 #define WNN_OKURI_NO 0 /* ����ʤ� */ 196 #define WNN_OKURI_YES 1 /* ���� */ 197 /* �Ѵ����� */ 198 #define WNN_KANA_KOUHO 0 /* �Ҥ餬�� */ 199 #define WNN_KANJI_KOUHO 1 /* ���� */ 200 /* �Ѵ����� */ 201 #define WNN_KANREN 0 202 #define WNN_KANTAN_DAI 1 203 #define WNN_KANZEN_DAI 2 204 #define WNN_KANTAN_SHO 3 205 #define WNN_KANZEN_SHO 4 206 207 /* �۷��� �Ѵ����� */ 208 #define WNN_IKEIJI_DAI (WNN_KANZEN_SHO+1) 209 210 #define WNN_FT_DICT_FILE 1 211 #define WNN_FT_HINDO_FILE 2 212 #define WNN_FT_FUZOKUGO_FILE 3 213 /* 214 * Hideyuki Kishiba (Jul. 8, 1994) 215 * New file type for FI-Wnn 216 */ 217 #define WNN_FT_FI_DICT_FILE 4 218 #define WNN_FT_FI_HINDO_FILE 5 219 220 #define WNN_STATIC_DICT 1 /* static dict */ 221 #define WNN_UD_DICT 2 /* updatable dict */ 222 #define WNN_REV_DICT 3 /* Updatable Dictonary with Reverse Index */ 223 #define WNN_REG_DICT 4 /* Regular Expressino Dictonary */ 224 /* 225 * Hideyuki Kishiba (Jul. 8, 1994) 226 * New dictionary type for FI-Wnn 227 */ 228 #define WNN_COMPACT_DICT 5 /* ����ѥ��ȼ��� */ 229 #define WNN_FI_SYSTEM_DICT 6 /* �ƣɴط������ƥ༭�� */ 230 #define WNN_FI_USER_DICT 7 /* �ƣɴط��桼������ */ 231 #define WNN_FI_HINDO_FILE 8 /* �ƣɴط����� */ 232 #define WNN_GROUP_DICT 9 /* ���롼���� */ 233 #define WNN_MERGE_DICT 10 /* �ޡ������� */ 234 235 #define WNN_SYSTEM_DICT 0x80000000 236 237 /* 238 * Seiji KUWARI (Dec. 14, 1994) 239 * Numbers of special dictionaries 240 */ 241 #define WNN_MAEKAKUTEI_DIC -2 242 #define WNN_MUHENKAN_DIC -3 243 #define WNN_BUNSETSUGIRI_DIC -4 244 245 /* for CHINESE PIN-IN : with Si Sheng (����) */ 246 #define CWNN_REV_DICT 0x103 /* Updatable with Reverse Index */ 247 248 /* for CHINESE: Bi Xing (ɮ��) */ 249 #define BWNN_REV_DICT 0x203 /* Updatable with Reverse Index */ 250 251 #define WNN_DIC_MERGE 4 /* for merge dic */ 252 #define WNN_DIC_GROUP 3 /* for group dic */ 253 #define WNN_DIC_TEMPORARY 2 254 #define WNN_DIC_RDONLY 1 255 #define WNN_DIC_RW 0 256 257 #define WNN_DIC_ADD_REV 1 /* ���Ѵ� */ 258 #define WNN_DIC_ADD_NOR 0 /* �̾���Ѵ� */ 259 260 /* header file for dic_syurui */ 261 #define WNN_FILE_NOT_EXIST -1 262 #define WNN_NOT_A_JISHO 0 263 /* KURI 264 #define WNN_USER_DIC 1 265 #define WNN_SYSTEM_DIC 3 266 */ 267 #define WNN_HINDO_FILE 4 268 #define WNN_FUZOKUGO_FILE 5 269 270 /* set_hindo operation */ 271 #define WNN_HINDO_NOP -2 272 #define WNN_IMA_ON -3 273 #define WNN_IMA_OFF -4 274 #define WNN_HINDO_INC -3 275 #define WNN_HINDO_DECL -4 276 #define WNN_ENTRY_NO_USE -1 277 278 /* set hindo probability */ 279 #define WNN_HINDO_NOT 0 280 #define WNN_HINDO_ALWAYS 1 281 #define WNN_HINDO_HIGH 2 282 #define WNN_HINDO_NORMAL 3 283 #define WNN_HINDO_LOW 4 284 285 /* Auto learning operation */ 286 #define WNN_MUHENKAN_LEARNING 1 287 #define WNN_BUNSETSUGIRI_LEARNING 2 288 289 #define WNN_NO_LEARNING -1 290 #define WNN_TEMPORARY_LEARNING -2 291 292 /* Wnn constant 293 */ 294 #define WNN_HOSTLEN 16 295 #define WNN_ENVNAME_LEN 32 296 297 /* js_who */ 298 #define WNN_MAX_ENV_OF_A_CLIENT 32 299 300 struct wnn_jwho { 301 int sd; /* jserver ��Υ����åȥǥ�������ץ�*/ 302 char user_name[64]; /* �桼��̾ */ 303 char host_name[64]; /* �ۥ���̾ */ 304 int env[WNN_MAX_ENV_OF_A_CLIENT]; /* ���Υ��饤����Ȥ����Ѥ��Ƥ��� 305 �Ķ��ֹ�������Ƥ���Ȥ���ˤϡ�-1 ������ */ 306 }; 307 typedef struct wnn_jwho WNN_JWHO; 308 309 /* js_env_list */ 310 #define WNN_MAX_JISHO_OF_AN_ENV 30 311 #define WNN_MAX_FILE_OF_AN_ENV 60 312 313 struct wnn_env_info { 314 int env_id; /* �Ķ��ֹ� */ 315 char env_name[WNN_ENVNAME_LEN]; /* �Ķ�̾ */ 316 int ref_count; /* ���ȿ� */ 317 /* struct wnn_param; */ 318 int fzk_fid; /* ��°��Υե������ֹ� */ 319 int jishomax; /* ���Ѥ��Ƥ��뼭��θĿ� */ 320 int jisho[WNN_MAX_JISHO_OF_AN_ENV]; /* ���Ѥ��Ƥ��뼭��μ����ֹ档 321 �ǽ��jishomax�Ĥ�����̣������ */ 322 int file[WNN_MAX_FILE_OF_AN_ENV]; /* ���δĶ��ˤĤʤ��äƤ��� 323 �ե������ֹ�(�����Ƥ���Ȥ���ˤϡ�-1 ������) */ 324 }; 325 typedef struct wnn_env_info WNN_ENV_INFO; 326 327 #define WNN_COMMENT_LEN 512 /* jisho no comment no nagasa */ 328 #define WNN_F_NAMELEN 256 329 #define WNN_PASSWD_LEN 16 /* File Passwd Length */ 330 331 332 struct wnn_dic_info { 333 int dic_no; /* �����ֹ� */ 334 int body; /* �������ΤΥե������ֹ� */ 335 int hindo; /* ���٤Υե������ֹ� */ 336 int rw; /* ������Ͽ��ǽ���ɤ��� 337 (WNN_DIC_RW, WNN_DIC_RDONLY) */ 338 int hindo_rw; /* ���٤�������ǽ���ɤ��� 339 (WNN_DIC_RW, WNN_DIC_RDONLY) */ 340 int enablef; /* �������椫�ɤ��� 341 (1 = ������, 0 = ��������) */ 342 int nice; /* ������Ѵ�����ͥ���� */ 343 int rev; /* ���Ѵ������ɤ���(1 = ���Ѵ�, 0 = ���Ѵ�) */ 344 /* added H.T */ 345 w_char comment[WNN_COMMENT_LEN]; /* ����Υ����� */ 346 char fname[WNN_F_NAMELEN]; /* ����Υե�����̾ */ 347 char hfname[WNN_F_NAMELEN]; /* ���٤Υե�����̾ */ 348 char passwd[WNN_PASSWD_LEN]; /* ����Υѥ���� */ 349 char hpasswd[WNN_PASSWD_LEN]; /* ���٤Υѥ���� */ 350 int type; /* ����μ���(WNN_UD_DICT,WNN_STATIC_DICT) */ 351 int gosuu; /* ����θ�� */ 352 int localf; 353 int hlocalf; 354 }; 355 356 typedef struct wnn_dic_info WNN_DIC_INFO; 357 358 /* Hideyuki Kishiba (Dec. 1, 1994) 359 ��°��ե������������ѹ�¤�� */ 360 struct wnn_fzk_info { 361 w_char comment[WNN_COMMENT_LEN]; /* ��°��Υ����� */ 362 char fname[WNN_F_NAMELEN]; /* ��°��Υե�����̾ */ 363 }; 364 365 typedef struct wnn_fzk_info WNN_FZK_INFO; 366 367 struct wnn_file_stat { 368 int type; /* �ե�����μ��� 369 WNN_STATIC_DICT ����������� 370 WNN_UD_DICT ��Ͽ��ǽ�������� 371 WNN_HINDO_FILE ���٥ե����� 372 WNN_FUZOKUGO_FILE ��°��ե����� 373 WNN_NOT_A_JISHO ����¾ */ 374 }; 375 376 typedef struct wnn_file_stat WNN_FILE_STAT; 377 378 /* */ 379 extern int wnn_errorno; /* Wnn�Υ��顼�Ϥ����ѿ������� */ 380 381 extern char *wnn_dic_types[]; /* "����","��Ͽ","���Ѵ�","����" */ 382 383 extern char *cwnn_dic_types[]; /* "����","��Ͽ","���Ѵ�","����" */ 384 extern char *bwnn_dic_types[]; /* "����","��Ͽ","���Ѵ�","����" */ 385 386 #define FILE_ALREADY_READ -2 387 388 /* ���ι�¤�Τϡ��饤�֥���������Ѥ����� */ 389 struct wnn_jserver_id { 390 int sd; 391 char js_name[40]; 392 int js_dead; 393 jmp_buf js_dead_env; /* �����Ф�������������Ǥ���env */ 394 int js_dead_env_flg; /* jd_server_dead_env��ͭ�����ݤ� */ 395 }; 396 397 typedef struct wnn_jserver_id WNN_JSERVER_ID; 398 399 /* ���ι�¤�Τϡ��饤�֥���������Ѥ����� */ 400 struct wnn_env { 401 int env_id; 402 WNN_JSERVER_ID *js_id; 403 char lang[16]; /* for exsample "ja_JP" */ 404 int muhenkan_mode; 405 int bunsetsugiri_mode; 406 int kutouten_mode; 407 int kakko_mode; 408 int kigou_mode; 409 int autotune; 410 int autosave; 411 }; 412 413 typedef struct wnn_env WNN_ENV; 414 415 struct wnn_param { 416 int n; /* ��(��)ʸ����ϤΣ� */ 417 int nsho; /* ��ʸ����ξ�ʸ��κ���� */ 418 int p1; /* ��Ω������٤Υѥ��� */ 419 int p2; /* ��ʸ��Ĺ�Υѥ��� */ 420 int p3; /* ��Ω��Ĺ�Υѥ��� */ 421 int p4; /* ���Ȥä���ӥåȤΥѥ��� */ 422 int p5; /* ����Υѥ��� */ 423 int p6; /* ��ʸ���ɾ���ͤΥѥ��� */ 424 int p7; /* ��ʸ��Ĺ�Υѥ��� */ 425 int p8; /* ��ʸ����Υѥ��� */ 426 int p9; /* �����ʻ� ���������� */ 427 int p10; /* �����ʻ� ���ʤ����� *//* CWNN:�ѿ������� */ 428 int p11; /* �����ʻ� �ѿ������� *//* CWNN:��������� */ 429 int p12; /* �����ʻ� ��������� *//* CWNN:����̤����� */ 430 int p13; /* �����ʻ� �ij�̤����� *//* CWNN:�ij�̤����� */ 431 int p14; /* �����ʻ� ��°������� *//* BWNN:No of koho */ 432 int p15; /* �����ʻ� ����̤����� *//* CWNN:Not used */ 433 }; 434 435 #define WNN_ENV_LAST_IS_FIRST_MASK (1<<0) 436 #define WNN_ENV_COMPLEX_CONV_MASK (1<<1) 437 #define WNN_ENV_OKURI_LEARN_MASK (1<<2) 438 #define WNN_ENV_OKURI_MASK (1<<3) 439 #define WNN_ENV_PREFIX_LEARN_MASK (1<<4) 440 #define WNN_ENV_PREFIX_MASK (1<<5) 441 #define WNN_ENV_SUFFIX_LEARN_MASK (1<<6) 442 #define WNN_ENV_COMMON_LAERN_MASK (1<<7) 443 #define WNN_ENV_FREQ_FUNC_MASK (1<<8) 444 #define WNN_ENV_NUMERIC_MASK (1<<9) 445 #define WNN_ENV_ALPHABET_MASK (1<<10) 446 #define WNN_ENV_SYMBOL_MASK (1<<11) 447 #define WNN_ENV_YURAGI_MASK (1<<12) 448 #define WNN_ENV_RENDAKU_MASK (1<<13) 449 #define WNN_ENV_BUNSETSUGIRI_LEARN_MASK (1<<14) 450 #define WNN_ENV_MUHENKAN_LEARN_MASK (1<<15) 451 #define WNN_ENV_FI_RELATION_LEARN_MASK (1<<16) 452 #define WNN_ENV_FI_FREQ_FUNC_MASK (1<<17) 453 #define WNN_ENV_KUTOUTEN_MASK (1<<18) 454 #define WNN_ENV_KAKKO_MASK (1<<19) 455 #define WNN_ENV_KIGOU_MASK (1<<20) 456 457 struct wnn_henkan_env { 458 int last_is_first_flag; /* �ǽ����Ѻ�ͥ�� */ 459 int complex_flag; /* ʣ���ͥ�� */ 460 int okuri_learn_flag; /* ������ؽ� */ 461 int okuri_flag; /* ��������� */ 462 int prefix_learn_flag; /* ��Ƭ��ؽ� */ 463 int prefix_flag; /* ��Ƭ����� */ 464 int suffix_learn_flag; /* ������ؽ� */ 465 int common_learn_flag; /* ���Ѹ�ؽ� */ 466 int freq_func_flag; /* ���پ徺��Ψ�ؿ� */ 467 int numeric_flag; /* ���������ν��ɽ����ˡ */ 468 int alphabet_flag; /* ��������ե��٥åȤν��ɽ����ˡ */ 469 int symbol_flag; /* ��������ν��ɽ����ˡ */ 470 /* 471 * FI-Wnn �ɲ�ʬ 472 * WATANABE Yasuhisa (Oct. 14, 1994) 473 */ 474 int yuragi_flag; /* Ĺ������餮���� */ 475 476 int rendaku_flag; /* Ϣ������ */ 477 int bunsetsugiri_flag; /* ʸ���ڤ�ؽ� */ 478 int muhenkan_flag; /* ̵�Ѵ��ؽ� */ 479 int fi_relation_learn_flag; /* �ƣɴط��ؽ� */ 480 int fi_freq_func_flag; /* �ƣɴط����پ徺��Ψ�ؿ� */ 481 /* 482 * FI-Wnn �ɲ�ʬ 483 * Seiji KUWARI (Nov. 28, 1994) 484 */ 485 int kutouten_flag; /* ������ */ 486 int kakko_flag; /* ��� */ 487 int kigou_flag; /* ���� */ 488 }; 489 490 /* dictionary type bit mask for js_fi_dic_list[_all] */ 491 #define WNN_DIC_WNN_SYSTEM_MASK (1<<0) 492 #define WNN_DIC_WNN_USER_MASK (1<<1) 493 #define WNN_DIC_FI_SYSTEM_MASK (1<<2) 494 #define WNN_DIC_FI_USER_MASK (1<<3) 495 #define WNN_DIC_BUNSETSU_MASK (1<<4) 496 #define WNN_DIC_MUHENKAN_MASK (1<<5) 497 #define WNN_DIC_TEMPORARY_MASK (1<<6) 498 #define WNN_DIC_NO_AUTOLEARN_MASK \ 499 (WNN_DIC_WNN_SYSTEM_MASK | WNN_DIC_WNN_USER_MASK) 500 #define WNN_DIC_AUTOLEARN_MASK \ 501 (WNN_DIC_BUNSETSU_MASK | WNN_DIC_MUHENKAN_MASK | WNN_DIC_TEMPORARY_MASK) 502 #define WNN_DIC_WNN_ALL_MASK \ 503 (WNN_DIC_NO_AUTOLEARN_MASK | WNN_DIC_AUTOLEARN_MASK) 504 #define WNN_DIC_FI_ALL_MASK \ 505 (WNN_DIC_FI_SYSTEM_MASK | WNN_DIC_FI_USER_MASK) 506 #define WNN_DIC_ALL_MASK \ 507 (WNN_DIC_WNN_ALL_MASK | WNN_DIC_FI_ALL_MASK) 508 509 510 struct wnn_file_info_struct { 511 int fid; /* �ե������ֹ� */ 512 char name[WNN_F_NAMELEN]; /* �ե�����̾ */ 513 int localf; /* �����С������ȤΥե����뤫�ɤ��� 514 1: �����С������� 515 0: ���饤����ȡ������� */ 516 int type; /* �ե�����μ��� */ 517 int ref_count; /* (�Ķ������)���ȿ� */ 518 }; 519 520 typedef struct wnn_file_info_struct WNN_FILE_INFO_STRUCT; 521 522 #define WNN_VECT_L ((256+8*4-1)/(8*4) + 5) /***** !!!!! ****/ 523 524 struct wnn_sho_bunsetsu { 525 int end; /* ����ʸ��� end char index */ 526 int start; /* ����ʸ��� top char index */ 527 int jiriend; /* ����ʸ��μ�Ω�� end char index */ 528 int dic_no; /* ��Ω��μ�����Υ���ȥ��ֹ� */ 529 int entry; /* ����ʸ��μ�Ω�켭�� entry */ 530 531 int hinsi; /* ��Ω���ʻ� */ 532 int status; /* ��ʸ�����Ƭ�� */ 533 int status_bkwd; /* usiro ��ʸ�����³�Ǥ��뤫 */ 534 int hindo; /* ���伫Ω������� */ 535 int ima; /* ���伫Ω��κ��Ȥä���ӥå� */ 536 int kangovect; /* ��³�٥��ȥ�ơ��֥�ؤΥݥ��� */ 537 int hyoka; /* ��ʸ��ɾ���� */ 538 w_char *kanji; /* ��Ω��ʸ���� */ 539 w_char *yomi; /* ��Ω����ɤ�ʸ���� */ 540 w_char *fuzoku; /* ��°��ʸ���� */ 541 /* 542 *���٤ˤĤ��Ƥϡ����٥ե����뤬���ꤵ��Ƥ�����ϡ� 543 *hindo = ���٥ե������(��)������ + �������(��)������ 544 *ima = ���٥ե�����κ��Ȥä���ӥå� 545 * 546 *���٥ե����뤬���ꤵ��Ƥ��ʤ����ˤϡ� 547 *hindo = �������(��)�����͡�ima = ������κ��Ȥä���ӥå� 548 *�Ǥ��롣�����ǡ��������ͤȤϡ��������7�ӥåȤ˰��̤��줿�ͤǤ��롣 549 *���������ͤǤϤʤ��������ͤ��֤��Τϡ��Ѵ���̤ΥǥХå��Τ���Ǥ��롣 550 */ 551 }; 552 553 struct wnn_dai_bunsetsu { 554 int end; /* ����ʸ��� end char index */ 555 int start; /* ����ʸ��� top char index */ 556 struct wnn_sho_bunsetsu *sbn; /* ��ʸ����Ϸ�̤ؤΥݥ��� */ 557 int hyoka; /* ��ʸ��ɾ���� */ 558 int sbncnt; /* ��ʸ��� (������ξ��ϡ��������) 559 DSD_SBN�ϡ�*sbn ���� sbncnt �������� */ 560 }; 561 562 struct wnn_jdata { 563 int dic_no; /* �����ֹ� */ 564 int serial; /* ������Υ���ȥ��ֹ� */ 565 int hinshi; /* �ʻ��ֹ�(�ʻ��ֹ���ʻ�̾���б��ϡ�manual/etc 566 �β���) */ 567 int hindo; /* ���� */ 568 int ima; /* ���Ȥä���ӥå� */ 569 int int_hindo; /* ���������� */ 570 int int_ima; /* �����⡢���Ȥä���ӥå� */ 571 w_char *yomi; /* �ɤߤ�ʸ���� */ 572 w_char *kanji; /* ����ʸ���� */ 573 w_char *com; /* ����ȥ�Υ�����ʸ���� */ 574 /* 575 *���٤ˤĤ��Ƥϡ����٥ե����뤬���ꤵ��Ƥ�����ϡ� 576 *hindo = ���٥ե������(����)�����͡�ima = ���٥ե�����κ��Ȥä���ӥå� 577 *int_hindo = �������(����)�����͡�int_ima = ������κ��Ȥä���ӥå� 578 * 579 *���٥ե����뤬���ꤵ��Ƥ��ʤ����ˤϡ� 580 *hindo = �������(����)�����͡�ima = ������κ��Ȥä���ӥå� 581 *int_hindo = -1��int_ima = -1 582 * 583 *���������ɤ���ξ��Ǥ⡢����ȥ꤬������ߤξ��֤λ��ˤϡ� 584 *hindo = -1, ima = 0 ���뤤�ϡ� 585 *int_hindo = -1, int_ima = 0 �Ȥʤ롣 586 *�����ǡ�(����)�����ͤȤϡ��������7�ӥåȤ˰��̤��줿�����ͤ��顢 587 *�ºݤ��ͤ����ꤷ���ͤǤ��롣 588 */ 589 }; 590 591 struct wnn_ret_buf { 592 int size; /* buf ���� alloc ����Ƥ����礭�� */ 593 char *buf; /* malloc �ʤɤǤȤ�줿�ΰ� */ 594 }; 595 596 /* 597 * Hideyuki Kishiba (Sep. 20, 1994) 598 * ���ѣƣɴط������ѹ�¤�Τ�������� 599 */ 600 struct fi_rel_data { 601 int fi_dic_no; /* �ƣɴط�����μ����ֹ� */ 602 int dic_no; /* ��³�������μ����ֹ� */ 603 int entry; /* ��³�������Υ���ȥ��ֹ� */ 604 int offset; /* �ƣɴط��ǡ����Υ��ե��å��ֹ� */ 605 int fi_hindo; /* �ƣɴط���³���٤������� */ 606 int fi_ima; /* �ƣɴط���³���ӥåȤ������� */ 607 }; 608 609 typedef struct fi_rel_data FI_PRIO_DATA; 610 611 /* 612 * Hideyuki Kishiba (Sep. 20, 1994) 613 * ���ѣƣɴط��������ѹ�¤�Τ�������� 614 */ 615 struct wnn_fi_rel_buf { 616 int size; /* alloc ����Ƥ���ƣɴط��ǡ����� */ 617 int num; /* ͭ���ƣɴط��ǡ����� */ 618 struct fi_rel_data *fi_buf; /* �ƣɴط��ǡ�����¤������ؤΥݥ��� */ 619 }; 620 621 /* 622 * Hideyuki Kishiba (Nov. 24, 1994) 623 * ������ƣ��Ѵ��ѹ�¤�Τ�������� 624 */ 625 #define WNN_PREV_BUN_SUU 2 /* �Ф��Ƥ���ľ������ʸ��� */ 626 627 /* ľ���˳��ꤷ��ʸ��γƾ����Ф��Ƥ�����¤�� */ 628 struct wnn_prev_bun { 629 int dic_no; /* Wnn �����ֹ� */ 630 int entry; /* ����ȥ��ֹ� */ 631 int real_kanjilen; /* ����ʸ��������°��ʤ���*/ 632 w_char kouho[256]; /* ����ʸ�������°�줢��� 633 256 == LENGTHKANJI */ 634 int jirilen; /* ��Ω���ɤ�Ĺ */ 635 int hinsi; /* �ʻ� */ 636 }; 637 638 639 #define WNN_F_UNIQ_LEN (sizeof(struct wnn_file_uniq)) 640 641 /* hinsi name used in jlib and jserver */ 642 #define WNN_HINSI_MEISI "̾��" 643 #define WNN_HINSI_TANKAN "ñ����" 644 #define WNN_HINSI_SUUSI "����" 645 #define WNN_HINSI_SETTOUO "��Ƭ��(��)" 646 #define WNN_HINSI_SETSUBI "������" 647 #define WNN_HINSI_RENDAKU "Ϣ��" 648 #define WNN_HINSI_TELNO "�����ֹ�" 649 #define WNN_HINSI_ZIPCODE "���ֹ�" 650 #define WNN_ROOT_HINSI_NODE "/" 651 #define WNN_UNUSE_HINSI 9 652 653 654 /* ���ι�¤�Τϡ��饤�֥���������Ѥ����� */ 655 struct wnn_file_head { 656 struct wnn_file_uniq{ 657 int time; 658 int dev; 659 int inode; 660 char createhost[WNN_HOSTLEN]; 661 } file_uniq; 662 struct wnn_file_uniq file_uniq_org; 663 int file_type; 664 char file_passwd[WNN_PASSWD_LEN]; 665 }; 666 667 668 #define WNN_HINSI_NAME_LEN 64 669 670 #define WNN_FILE_HEADER_LEN (WNN_PASSWD_LEN + 8 + WNN_FILE_STRING_LEN + \ 671 sizeof(struct wnn_file_uniq) * 2 + 4) 672 /* 673 8 is for future use 674 4 is for file_type. 675 */ 676 677 /* 678 JSLIB function declaration 679 */ 680 #define js_open(server, timeout) js_open_lang(server, "ja_JP", timeout) 681 #define js_connect(server,env_name) js_connect_lang(server, env_name, "ja_JP") 682 683 extern WNN_JSERVER_ID *js_open_lang(); 684 extern unsigned int dispname_to_ipaddr(); 685 extern int js_close(); 686 extern WNN_JSERVER_ID *js_change_current_jserver(); 687 extern struct wnn_env *js_connect_lang(); 688 extern int js_disconnect(); 689 extern int js_env_list(); 690 extern int js_param_set(); 691 extern int js_param_get(); 692 extern char *js_get_lang(); 693 /**************************************/ 694 extern int js_access(); 695 extern int js_dic_add(); 696 extern int js_dic_delete(); 697 extern int js_dic_file_create(); 698 extern int js_dic_file_create_client(); 699 extern int js_dic_info(); 700 extern int js_dic_list(); 701 extern int js_dic_list_all(); 702 extern int js_dic_use(); 703 extern int js_env_exist(); 704 extern int js_env_sticky(); 705 extern int js_env_un_sticky(); 706 extern int js_file_comment_set(); 707 extern int js_file_discard(); 708 extern int js_file_info(); 709 extern int js_file_list(); 710 extern int js_file_list_all(); 711 extern int js_file_loaded(); 712 extern int js_file_loaded_local(); 713 extern int js_file_password_set(); 714 extern int js_file_read(); 715 extern int js_file_receive(); 716 extern int js_file_remove(); 717 extern int js_file_remove_client(); 718 extern int js_file_send(); 719 extern int js_file_stat(); 720 extern int js_file_write(); 721 extern void js_flush(); 722 extern int js_fuzokugo_get(); 723 extern int js_fuzokugo_set(); 724 extern int js_hindo_file_create(); 725 extern int js_hindo_file_create_client(); 726 extern int js_hindo_set(); 727 extern int js_hinsi_dicts(); 728 extern int js_hinsi_list(); 729 extern int js_hinsi_name(); 730 extern int js_hinsi_number(); 731 extern int js_hinsi_table_set(); 732 extern int js_isconnect(); 733 extern int js_kanren(); 734 extern int js_kantan_dai(); 735 extern int js_kantan_sho(); 736 extern int js_kanzen_dai(); 737 extern int js_kanzen_sho(); 738 extern int js_kill(); 739 extern int js_mkdir(); 740 extern int js_version(); 741 extern int js_who(); 742 extern int js_word_add(); 743 extern int js_word_comment_set(); 744 extern int js_word_delete(); 745 extern int js_word_info(); 746 extern int js_word_search(); 747 extern int js_word_search_by_env(); 748 749 750 extern int js_access_add_host(); 751 extern int js_access_remove_host(); 752 extern int js_access_add_user(); 753 extern int js_access_remove_user(); 754 extern int js_access_enable(); 755 extern int js_access_disable(); 756 extern char **js_access_get_info(); 757 758 extern int js_is_loaded_temporary_dic(); 759 extern int js_temporary_dic_add(); 760 extern int js_temporary_dic_delete(); 761 extern int js_autolearning_word_add(); 762 extern int js_temporary_word_add(); 763 764 extern int js_set_autolearning_dic(); 765 extern int js_get_autolearning_dic(); 766 767 extern int js_set_henkan_env(); 768 extern int js_get_henkan_env(); 769 extern int js_get_henkan_env_local(); 770 extern int js_set_henkan_hinsi(); 771 extern int js_get_henkan_hinsi(); 772 extern int js_henkan_with_data(); 773 774 775 /* 776 * Hideyuki Kishiba (Jul. 8, 1994) 777 * New js_lib functions for FI-Wnn 778 */ 779 extern int js_fi_dic_add(); 780 extern int js_fi_hindo_file_create(); 781 extern int js_fi_hindo_file_create_client(); 782 783 extern int js_fi_kanren(); 784 extern int js_set_fi_priority(); 785 extern int js_optimize_fi(); 786 787 extern int js_fi_dic_list(); 788 extern int js_fi_dic_list_all(); 789 extern int js_fuzokugo_list(); 790 791 792 #endif /* _JSLIB_H_ */ 793