/usr/include/juman.h is in libjuman-dev 7.0-3.4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 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 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 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 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 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 | /*
==============================================================================
juman.h
1990/12/06/Thu Yutaka MYOKI(Nagao Lab., KUEE)
1990/01/09/Wed Last Modified
>>> 94/02 changed by T.Nakamura <<<
==============================================================================
*/
/*
------------------------------------------------------------------------------
inclusion of header files
------------------------------------------------------------------------------
*/
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#include <ctype.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
#include <stdarg.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <time.h>
/* added by T.Nakamura */
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "juman_pat.h"
/*
* MS Windows の場合は SJIS入出力になるよう変更
* Added by Taku Kudoh (taku@pine.kuee.kyoto-u.ac.jp)
* Thu Oct 29 03:42:45 JST 1998
*/
#ifdef _WIN32
extern char *toStringEUC(char *str);
extern char *toStringSJIS(char *str);
#include <stdarg.h>
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#if ! defined __CYGWIN__
typedef char * caddr_t;
#endif
#endif
/* あとで 競合するらしいので undef (tricky?) */
#undef TRUE
#undef FALSE
#endif
#define EOf 0x0b /* クライアントサーバ間通信でのEOF */
#define NDBM_KEY_MAX 256
#define NDBM_CON_MAX 1024
/*
------------------------------------------------------------------------------
global definition of macros
------------------------------------------------------------------------------
*/
#define FALSE ((int)(0))
#define TRUE (!(FALSE))
#define BOOL int
#define U_CHAR unsigned char
#define U_INT unsigned int
/* #define SEEK_SET 0 * use in "fseek()" */
/* #define SEEK_CUR 1 * use in "fseek()" */
/* #define SEEK_END 2 * use in "fseek()" */
#define EOA ((char *)(-1)) /* end of arguments */
#ifndef FILENAME_MAX /* maximum of filename */
#define FILENAME_MAX 1024
#endif
#ifndef BUFSIZE /* (char) size of buffer */
#define BUFSIZE 1025
#endif
#define NAME_MAX_ 1024 /* maximum of various names */
#define MIDASI_MAX 129 /* maximum length of MIDASI */
#define YOMI_MAX 129 /* maximum length of YOMI */
#define IMI_MAX 1024 /* maximum length of IMI */
#define ENV_JUMANPATH "JUMANPATH"
#define GRAMMARFILE "JUMAN.grammar"
#define CLASSIFY_NO 128
#define KATUYOUFILE "JUMAN.katuyou"
#define TYPE_NO 128
#define FORM_NO 128
#define CONNECTFILE "JUMAN.connect"
#define KANKEIFILE "JUMAN.kankei"
/* added by kuro */
#define OPTIONFILE "JUMAN.option"
#define S_POSTFIX ".dic"
/* file postfix for s-expression dic-file */
#define I_POSTFIX ".int"
/* file postfix for intermediate dic-file */
#define I_FILE_ID "this is INT-file for makehd.\n"
#define CONS 0
#define ATOM 1
#define NIL ((CELL *)(NULL))
#define COMMENTCHAR ';'
#define BPARENTHESIS '('
#define BPARENTHESIS2 '<'
#define BPARENTHESIS3 '['
#define EPARENTHESIS ')'
#define EPARENTHESIS2 '>'
#define EPARENTHESIS3 ']'
#define SCANATOM "%[^(;) \n\t]"
#define NILSYMBOL "NIL"
#define CELLALLOCSTEP 1024
#define BLOCKSIZE 16384
#define Consp(x) (!Null(x) && (_Tag(x) == CONS))
#define Atomp(x) (!Null(x) && (_Tag(x) == ATOM))
#define _Tag(cell) (((CELL *)(cell))->tag)
#define _Car(cell) (((CELL *)(cell))->value.cons.car)
#define _Cdr(cell) (((CELL *)(cell))->value.cons.cdr)
#define Null(cell) ((cell) == NIL)
#define new_cell() (cons(NIL, NIL))
#define Eq(x, y) (x == y)
#define _Atom(cell) (((CELL *)(cell))->value.atom)
#define EUC(c) ((c) | '\x80')
#define endchar(str) (str[strlen(str)-1])
#define M 30 /* order of B-tree */
#define MM (M*2) /* order*2 */
#define PTRNIL (-1L) /* instead of NULL pointer */
#define KANJI_CODE 128*128
#define BASIC_FORM "基本形"
#define TABLEFILE "jumandic.tab"
#define MATRIXFILE "jumandic.mat"
#define DICFILE "jumandic.dat"
#define PATFILE "jumandic.pat"
#define calc_index(x) ((((int)(*(x)&0x7f))<<7)|((int)(*((x)+1))&0x7f))
enum _ExitCode { NormalExit,
SystemError, OpenError, AllocateError,
GramError, DicError, ConnError,
ConfigError, ProgramError,
SyntaxError, UnknownId, OtherError };
/* added by T.Utsuro for weight of rensetu matrix */
#define DEFAULT_C_WEIGHT 10
/* added by S.Kurohashi for mrph weight default values */
#define MRPH_DEFAULT_WEIGHT 10
/* .jumanrc default values */
#define CLASS_COST_DEFAULT 10
#define RENSETSU_WEIGHT_DEFAULT 100
#define KEITAISO_WEIGHT_DEFAULT 1
#define COST_WIDTH_DEFAULT 20
#define UNDEF_WORD_DEFAULT 10000
#define RENGO_ID "999" /* yamaji */
#define RENGO_DEFAULT_WEIGHT 0.5
/* for juman_lib.c */
#define LENMAX 50000
#define BUFFER_BLOCK_SIZE 1000
#define Op_B 0
#define Op_M 1
#define Op_P 2
#define Op_BB 3
#define Op_PP 4
#define Op_F 0
#define Op_E 1
#define Op_C 2
#define Op_EE 3
#define Op_E2 4
#define Op_NODEBUG 0
#define Op_DEBUG 1
#define Op_DEBUG2 2
#define MAX_PATHES 500
#define MAX_PATHES_WK 5000
#define CONNECT_MATRIX_MAX 1000
#define KUUHAKU 0x20
#define HANKAKU 0x80
#define PRIOD 0xa1a5
#define CHOON 0xa1bc
#define KIGOU 0xa3b0
#define SUJI 0xa3c0
#define ALPH 0xa4a0
#define HIRAGANA 0xa5a0
#define KATAKANA 0xa6a0
#define GR 0xb0a0
#define KANJI 0xffff
#if defined(IO_ENCODING_EUC) || defined(IO_ENCODING_SJIS)
#define BYTES4CHAR 2 /* EUC-JP or SHIFT-JIS */
#else
#define BYTES4CHAR 3 /* UTF-8 (usually) */
#endif
#define WIN_AZURE_DICFILE_DEFAULT ".\\dic\\"
#define WIN_AZURE_AUTODICFILE_DEFAULT ".\\autodic\\"
#define WIN_AZURE_WIKIPEDIADICFILE_DEFAULT ".\\wikipediadic\\"
#ifdef _WIN32
#ifndef strcasecmp
#define strcasecmp stricmp
#endif
#ifndef strncasecmp
#define strncasecmp strnicmp
#endif
#ifndef VERSION
#define VERSION "7.0"
#endif
#ifndef PACKAGE_NAME
#define PACKAGE_NAME "juman"
#endif
#endif
/*
------------------------------------------------------------------------------
global type definition of structures
------------------------------------------------------------------------------
*/
/* <car> 部と <cdr> 部へのポインタで表現されたセル */
typedef struct _BIN {
void *car; /* address of <car> */
void *cdr; /* address of <cdr> */
} BIN;
/* <BIN> または 文字列 を表現する完全な構造 */
typedef struct _CELL {
int tag; /* tag of <cell> */
/* 0: cons */
/* 1: atom */
union {
BIN cons;
U_CHAR *atom;
} value;
} CELL;
/* "malloc" の回数を減少させるため,一定のメモリ領域を確保するテーブル */
typedef struct _CELLTABLE {
void *pre;
void *next;
int max;
int n;
CELL *cell;
} CELLTABLE;
/* changed by T.Nakamura and S.Kurohashi
構造体 MRPH がすべての情報を持ち,
構造体 MORPHEME はなくなった */
typedef struct _MRPH {
U_CHAR midasi[MIDASI_MAX];
U_CHAR midasi2[MIDASI_MAX];
U_CHAR yomi[YOMI_MAX];
U_CHAR imis[IMI_MAX];
CELL *imi;
char hinsi;
char bunrui;
char katuyou1;
char katuyou2;
U_CHAR weight;
int con_tbl;
int length;
} MRPH;
/* 形態品詞の分類・細分類 */
typedef struct _CLASS {
U_CHAR *id;
int cost; /*品詞コスト by k.n*/
int kt;
} CLASS;
/* 活用型 */
typedef struct _TYPE {
U_CHAR *name;
} TYPE;
/* 活用形 */
typedef struct _FORM {
U_CHAR *name;
U_CHAR *gobi;
U_CHAR *gobi_yomi; /* カ変動詞来 などの読みのため */
} FORM;
/* 辞書登録オプション */
typedef struct _DICOPT {
int toroku;
} DICOPT;
/* stat() ライブラリ関数で使用 */
typedef struct stat STAT;
/* 連接表 */
typedef struct _RENSETU_PAIR {
int i_pos;
int j_pos;
int hinsi;
int bunrui;
int type;
int form;
U_CHAR *goi;
} RENSETU_PAIR;
typedef struct _process_buffer {
int mrph_p;
int start;
int end;
int score;
int path[MAX_PATHES]; /* 前の PROCESS_BUFFER の情報 */
int connect; /* FALSE なら接続禁止(連語の途中への割込禁止) */
} PROCESS_BUFFER;
typedef struct _chk_connect_wk {
int pre_p; /* PROCESS_BUFFER のインデックス */
int score; /* それまでのスコア */
} CHK_CONNECT_WK;
typedef struct _connect_cost {
short p_no; /* PROCESS_BUFFER のインデックス */
short pos;
int cost; /* コスト */
char opt;
} CONNECT_COST;
/*
------------------------------------------------------------------------------
additional type definition written by K. Yanagi >>>changed by T.Nakamura<<<
------------------------------------------------------------------------------
*/
typedef struct _DIC_FILES {
int number;
int now;
FILE *dic[MAX_DIC_NUMBER];
pat_node tree_top[MAX_DIC_NUMBER];
} DIC_FILES;
typedef struct _cost_omomi {
int rensetsu;
int keitaiso;
int cost_haba;
} COST_OMOMI; /*k.n*/
/*
------------------------------------------------------------------------------
prototype definition of functions
------------------------------------------------------------------------------
*/
/* iotool.c */
FILE *my_fopen(char *filename, char *mode);
FILE *pathfopen(char *filename, char *mode,
char *path, char *filename_path);
FILE *my_pathfopen(char *filename, char *mode,
char *path, char *filename_path);
int my_feof(FILE *fp);
void append_postfix(char *filename, char *affix);
void change_postfix(char *filename, char *affix1, char *affix2);
void getpath(char *cur_path, char *juman_path);
void *my_alloc(int n);
void *my_realloc(void *ptr, int n);
void my_exit(int exit_code);
void error(int errno, char *msg, ...);
char lower(char c);
char upper(char c);
int my_strlen(U_CHAR *s);
void my_strcpy(U_CHAR *s1, U_CHAR *s2);
int my_strcmp(U_CHAR *s1, U_CHAR *s2);
int compare_top_str(U_CHAR *s1, U_CHAR *s2);
int compare_top_str1(U_CHAR *s1, U_CHAR *s2);
int compare_top_str2(U_CHAR *s1, U_CHAR *s2);
int compare_end_str(U_CHAR *s1, U_CHAR *s2);
void ls(FILE *fp, char *p, char *f);
void print_current_time(FILE *fp);
void print_execute_time(FILE *fp, int dt, float dp);
/* lisp.c */
int s_feof(FILE *fp);
int s_feof_comment(FILE *fp);
CELL *make_cell(void);
/* CELLTABLE *make_cell_table(CELLTABLE *pre, int size);*/
CELL *tmp_atom(U_CHAR *atom);
CELL *cons(void *car, void *cdr);
CELL *car(CELL *cell);
CELL *cdr(CELL *cell);
int equal(void *x, void *y);
int length(CELL *list);
int ifnextchar(FILE *fp, int c);
int comment(FILE *fp);
CELL *s_read(FILE *fp);
CELL *s_read_atom(FILE *fp);
CELL *s_read_car(FILE *fp);
CELL *s_read_cdr(FILE *fp);
CELL *assoc(CELL *item, CELL *alist);
CELL *s_print(FILE *fp, CELL *cell);
CELL *_s_print_(FILE *fp, CELL *cell);
CELL *_s_print_cdr(FILE *fp, CELL *cell);
void *lisp_alloc(int n);
void lisp_alloc_push(void);
void lisp_alloc_pop(void);
/* grammar.c */
void error_in_grammar(int n, int line_no);
void initialize_class(void);
#define print_class(fp) print_class_(fp, 0, 8, "*")
void print_class_(FILE *fp, int tab1, int tab2, char *flag);
void read_class(FILE *fp);
void grammar(FILE *fp_out);
/* katuyou.c */
static void initialize_type_form(void);
void print_type_form(FILE *fp);
void read_type_form(FILE *fp);
void katuyou(FILE *fp);
/* connect.c */
void connect_table(FILE *fp_out);
void read_table(FILE *fp);
void check_edrtable(MRPH *mrph_p, CELL *x);
void check_table(MRPH *morpheme);
void check_table_for_rengo(MRPH *mrph_p);
int check_table_for_undef(int hinsi, int bunrui);
void connect_matrix(FILE *fp_out);
void read_matrix(FILE *fp);
int check_matrix(int postcon, int precon);
int check_matrix_left(int precon);
int check_matrix_right(int postcon);
/* zentohan.c */
unsigned char *zentohan(unsigned char *str1);
unsigned char *hantozen(unsigned char *str1);
/* for edr-dic */
void check_edrtable(MRPH *mrph_p, CELL *x);
|