1:
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;
13: wtype_t wt;
14: seq_ent_t se;
15: int ratio;
16: xstr str;
17: int id;
18: };
19:
20:
21:
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:
35: int dep_word_hash;
36:
37: unsigned int flag;
38: struct meta_word *mw;
39: };
40:
41:
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:
55:
56:
57: struct seg_ent {
58:
59: xstr str;
60:
61: int committed;
62:
63:
64: int nr_cands;
65: struct cand_ent **cands;
66:
67: int from, len;
68:
69:
70: int nr_metaword;
71: struct meta_word **mw_array;
72:
73:
74: enum seg_class best_seg_class;
75:
76:
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:
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