Create devel package not to install header and .pc file in binary
[platform/core/uifw/anthy.git] / anthy / segment.h
1 /* segment(ʸÀá) ¤ÎÄêµÁ */
2 #ifndef _segment_h_included_
3 #define _segment_h_included_
4
5 #include <anthy/segclass.h>
6 #include <anthy/wtype.h>
7 #include <anthy/xstr.h>
8 #include <anthy/dic.h>
9
10 /** ¸õÊä¤Î¹½À®Í×ÁÇ */
11 struct cand_elm {
12   int nth; /* -1¤Î¤È¤­¤Ï¼­½ñ¤«¤é¤Î³ä¤êÅö¤Æ¤ò¤ä¤Ã¤Æ¤¤¤Ê¤¤ */
13   wtype_t wt;
14   seq_ent_t se;
15   int ratio;/* ÉÑÅÙ¤òɾ²Á¤¹¤ëºÝ¤Ë»ÈÍѤ¹¤ëÈæΨ */
16   xstr str;/* ÊÑ´¹ÂоݤÎʸ»úÎó */
17   int id;/* ÊÑ´¹·ë²Ì¤Îʸ»úÎó¤ËÂФ¹¤ëhashÃÍ */
18 };
19
20 /** °ì¤Ä¤Î¸õÊä¤ËÁêÅö¤¹¤ë¡£
21  * anthy_release_cand_ent()¤Ç²òÊü¤¹¤ë
22  */
23 struct cand_ent {
24   /** ¸õÊä¤Î¥¹¥³¥¢ */
25   int score;
26   /** ÊÑ´¹¸å¤Îʸ»úÎó */
27   xstr str;
28   /** Í×ÁǤοô */
29   int nr_words;
30   /** ¸õÊä¤ò¹½À®¤¹¤ëÍ×ÁǤÎÇÛÎó */
31   struct cand_elm *elm;
32   /** ¼«Î©¸ìÉô¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ */
33   int core_elm_index;
34   /** ÉÕ°¸ì¤ÎhashÃÍ */
35   int dep_word_hash;
36   /** ¸õÊä¤Î¥Õ¥é¥° CEF_? */
37   unsigned int flag;
38   struct meta_word *mw;
39 };
40
41 /* ¸õÊä(cand_ent)¤Î¥Õ¥é¥° */
42 #define CEF_NONE           0
43 #define CEF_OCHAIRE        0x00000001
44 #define CEF_SINGLEWORD     0x00000002
45 #define CEF_HIRAGANA       0x00000004
46 #define CEF_KATAKANA       0x00000008
47 #define CEF_GUESS          0x00000010
48 #define CEF_USEDICT        0x00000020
49 #define CEF_COMPOUND       0x00000040
50 #define CEF_COMPOUND_PART  0x00000080
51 #define CEF_BEST           0x00000100
52 #define CEF_CONTEXT        0x00000200
53
54 /** ContextÆâ¤Ë¸ºß¤¹¤ëʸÀá¤ÎÎó
55  * release_seg_ent¤Ç²òÊü¤¹¤ë
56  */
57 struct seg_ent {
58   /* str¤Î¼ÂÂΤÏcontextÃæ¤Ë¤¢¤ë */
59   xstr str;
60   /* commit¤µ¤ì¤¿¸õÊä¤ÎÈֹ桢Éé¤Î¿ô¤Î¾ì¹ç¤Ï¤Þ¤À¥³¥ß¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤ */
61   int committed;
62   
63   /* ¸õÊä¤ÎÇÛÎó */
64   int nr_cands;/* ¸õÊä¤Î¿ô */
65   struct cand_ent **cands;/* ÇÛÎó */
66
67   int from, len;/* len == str.len */
68
69   /* Ê¸Àá¤Î¹½À® */
70   int nr_metaword;
71   struct meta_word **mw_array;
72
73   /* °ìÈÖÀ®ÀÓ¤ÎÎɤ«¤Ã¤¿¥¯¥é¥¹ */
74   enum seg_class best_seg_class;
75   /* °ìÈÖÀ®ÀÓ¤ÎÎɤ«¤Ã¤¿meta_word
76    * mw_arrayÃæ¤Ë¤â¡¢´Þ¤Þ¤ì¤ë¤³¤È¤¬´üÂԤǤ­¤ë¤¬¡¢ÊݾڤϤ·¤Ê¤¤ */
77   struct meta_word *best_mw;
78
79   struct seg_ent *prev, *next;
80 };
81
82 /** Ê¸Àá¤Î¥ê¥¹¥È */
83 struct segment_list {
84   int nr_segments;
85   struct seg_ent list_head;
86 };
87
88 /* ¸õÊä¤ò²òÊü¤¹¤ë(̵Â̤ËÀ¸À®¤·¤Æ¤·¤Þ¤Ã¤¿¤â¤ÎÅù) */
89 void anthy_release_cand_ent(struct cand_ent *s);
90
91 /**/
92 struct seg_ent *anthy_get_nth_segment(struct segment_list *c, int );
93 void anthy_print_candidate(struct cand_ent *ce);
94
95 /* compose.c */
96 /* ¸õÊä¤òºî¤ê½Ð¤¹ */
97 struct splitter_context;
98 void anthy_do_make_candidates(struct splitter_context *sc,
99                               struct seg_ent *e, int is_reverse);
100
101 #endif