Fix license
[platform/core/uifw/anthy.git] / anthy / depgraph.h
1 /* ÉÕ°¸ì¥°¥é¥Õ¤Î¥Ç¡¼¥¿¹½Â¤ */
2 #ifndef _depgraph_h_included_
3 #define _depgraph_h_included_
4
5 #include <anthy/segclass.h>
6 #include <anthy/wtype.h>
7
8 struct dep_transition {
9   /** Á«°ÜÀè¤Î¥Î¡¼¥É¤ÎÈÖ¹æ 0¤Î¾ì¹ç¤Ï½ªÃ¼ */
10   int next_node;
11   /** ÉÊ»ì */
12   int pos;
13   /** ³èÍÑ·Á */
14   int ct;
15   /* ÉÕ°¸ì¥¯¥é¥¹ */
16   enum dep_class dc;
17
18   int head_pos;
19   int weak;
20 };
21
22 typedef int ondisk_xstr;
23
24 struct dep_branch {
25   /* Á«°Ü¾ò·ï¤ÎÉÕ°¸ì¤ÎÇÛÎó */
26   /** ÇÛÎóĹ */
27   int nr_strs;
28   /** Á«°Ü¾ò·ï¤ÎÇÛÎó */
29   xstr **str;
30   ondisk_xstr *xstrs;
31
32   /** Á«°ÜÀè¤Î¥Î¡¼¥É */
33   int nr_transitions;
34   struct dep_transition *transition;
35 };
36
37 struct dep_node {
38   int nr_branch;
39   struct dep_branch *branch;
40 };
41
42 /** ¼«Î©¸ì¤ÎÉÊ»ì¤È¤½¤Î¸å¤Ë³¤¯ÉÕ°¸ì¤Î¥°¥é¥ÕÃæ¤Î¥Î¡¼¥É¤ÎÂбþ */
43 struct wordseq_rule {
44   wtype_t wt; /* ¼«Î©¸ì¤ÎÉÊ»ì */
45   int node_id; /* ¤³¤Î¼«Î©¸ì¤Î¸å¤í¤Ë³¤¯ÉÕ°¸ì¥°¥é¥ÕÃæ¤Î¥Î¡¼¥É¤Îid */
46 };
47
48 /** ÉÕ°¸ì¥°¥é¥Õ¤Î¥Õ¥¡¥¤¥ë¾å¤Ç¤Î·Á¼° */
49 struct ondisk_wordseq_rule {
50   char wt[8];
51   /* ¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼ */
52   int node_id;
53 };
54
55 /* ÉÕ°¸ì¥°¥é¥Õ */
56 struct dep_dic {
57   char* file_ptr;
58
59   int nrRules;
60   int nrNodes;
61
62   /* ¼«Î©¸ì¤«¤é¤ÎÀܳ¥ë¡¼¥ë */
63   struct ondisk_wordseq_rule *rules;
64   /* ÉÕ°¸ì´Ö¤ÎÀܳ¥ë¡¼¥ë */
65   struct dep_node* nodes;
66 };
67
68 #endif