(linenum→info "unix/slp.c:2238")

anthy/9100e/mkworddic/mkdic.h

    1: #ifndef _mkdic_h_included_
    2: #define _mkdic_h_included_
    3: 
    4: #include <stdio.h>
    5: #include <anthy/xstr.h>
    6: 
    7: /** 単語 */
    8: struct word_entry {
    9:   /** 品詞名 */
   10:   const char *wt_name;
   11:   /** 頻度 */
   12:   int raw_freq;
   13:   int source_order;
   14:   int freq;
   15:   /* 素性 */
   16:   int feature;
   17:   /** 単語 */
   18:   char *word_utf8;
   19:   /** 辞書ファイル中のオフセット */
   20:   int offset;
   21:   /** 属すyomi_entry*/
   22:   struct yomi_entry* ye;
   23: };
   24: 
   25: /** ある読み */
   26: struct yomi_entry {
   27:   /* 読みの文字列 */
   28:   xstr *index_xstr;
   29:   /* 読みの文字列(辞書ファイル内のインデックス) */
   30:   char *index_str;
   31:   /* 辞書ファイル中のページ中のオフセット */
   32:   int offset;
   33:   /* 各エントリ */
   34:   int nr_entries;
   35:   struct word_entry *entries;
   36:   /**/
   37:   struct yomi_entry *next;
   38:   struct yomi_entry *hash_next;
   39: };
   40: 
   41: #define YOMI_HASH (16384 * 16)
   42: 
   43: /* 辞書全体 */
   44: struct yomi_entry_list {
   45:   /* 見出しのリスト */
   46:   struct yomi_entry *head;
   47:   /* 辞書ファイル中の見出しの数 */
   48:   int nr_entries;
   49:   /* 見出しの中で単語を持つものの数 */
   50:   int nr_valid_entries;
   51:   /* 単語の数 */
   52:   int nr_words;
   53:   /**/
   54:   struct yomi_entry *hash[YOMI_HASH];
   55:   struct yomi_entry **ye_array;
   56:   /**/
   57:   int index_encoding;
   58:   int body_encoding;
   59: };
   60: 
   61: #define ADJUST_FREQ_UP 1
   62: #define ADJUST_FREQ_DOWN 2
   63: #define ADJUST_FREQ_KILL 3
   64: 
   65: /* 頻度補正用コマンド */
   66: struct adjust_command {
   67:   int type;
   68:   xstr *yomi;
   69:   const char *wt;
   70:   char *word;
   71:   struct adjust_command *next;
   72: };
   73: 
   74: /**/
   75: struct yomi_entry *find_yomi_entry(struct yomi_entry_list *yl,
   76:                                    xstr *index, int create);
   77: 
   78: /* 辞書書き出し用の補助 */
   79: void write_nl(FILE *fp, int i);
   80: 
   81: /**/
   82: const char *get_wt_name(const char *name);
   83: 
   84: /* mkudic.c
   85:  * 用例辞書を作る */
   86: struct uc_dict *create_uc_dict(void);
   87: void read_uc_file(struct uc_dict *ud, const char *fn);
   88: void make_ucdict(FILE *out, struct uc_dict *uc);
   89: /**/
   90: 
   91: /* writewords.c */
   92: void output_word_dict(struct yomi_entry_list *yl);
   93: 
   94: /* calcfreq.c */
   95: void calc_freq(struct yomi_entry_list *yl);
   96: 
   97: #endif
Syntax (Markdown)