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:
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:
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:
92: void output_word_dict(struct yomi_entry_list *yl);
93:
94:
95: void calc_freq(struct yomi_entry_list *yl);
96:
97: #endif