Fix license
[platform/core/uifw/anthy.git] / anthy / convdb.h
1 /* ÊÑ´¹·ë²Ì¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ */
2 #ifndef _convdb_h_included_
3 #define _convdb_h_included_
4
5 #include <anthy/anthy.h>
6
7 /* ÉÔÌÀ, OK, ¸íÊÑ´¹, don't care¤Î4¤Ä¤Î¥«¥Æ¥´¥ê¡¼¤ËʬÎह¤ë */
8 #define CHK_UNKNOWN 0
9 #define CHK_OK 1
10 #define CHK_MISS 2
11 #define CHK_DONTCARE 3
12
13 /**/
14 #define CONV_OK 0
15 #define CONV_SIZE_MISS 1
16 #define CONV_CAND_MISS 2
17 #define CONV_INVALID 4
18
19 /* ÊÑ´¹Á°¤ÈÊÑ´¹¸å¤Îʸ»úÎó¡¢·ë²Ì¤ËÂФ¹¤ëȽÄê¤ò³ÊǼ¤¹¤ë */
20 struct conv_res {
21   /* ¸¡º÷¤Î¥­¡¼ */
22   char *src_str;
23   char *res_str;
24   /* ¸õÊä¤ò³ä¤êÅö¤Æ¤¿¤â¤Î */
25   char *cand_str;
26   /**/
27   int *cand_check;
28   /**/
29   int check;
30   int used;
31   /**/
32   struct conv_res *next;
33 };
34
35 /* ÊÑ´¹·ë²Ì¤Î¥«¥¦¥ó¥È */
36 struct res_stat {
37   int unknown;
38   int ok;
39   int miss;
40   int dontcare;
41 };
42
43 /* ÊÑ´¹·ë²Ì¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ */
44 struct res_db {
45   /**/
46   struct conv_res res_list;
47   struct conv_res *tail;
48   /**/
49   int total;
50   struct res_stat res, split;
51 };
52
53 struct res_db *create_db(void);
54 void read_db(struct res_db *db, const char *fn);
55 struct conv_res *find_conv_res(struct res_db *db, anthy_context_t ac,
56                                const char *src, int conv);
57 void print_size_miss_segment_info(anthy_context_t ac, int nth);
58 void print_cand_miss_segment_info(anthy_context_t ac, int nth);
59 void print_context_info(anthy_context_t ac, struct conv_res *cr);
60
61 #endif