1 /* ʸÀᶳ¦¤Î¸¡½Ð¤Ë»È¤¦¥Ç¡¼¥¿ */
2 #ifndef _wordborder_h_included_
3 #define _wordborder_h_included_
7 #include <anthy/alloc.h>
8 #include <anthy/segclass.h>
9 #include <anthy/depgraph.h>
11 struct splitter_context;
14 * meta_word¤Î»ÈÍѲÄǽ¥Á¥§¥Ã¥¯¤Î¤ä¤êÊý
19 /* mw->wl¤¬Ìµ¤¤¤«¡¢wl¤¬»È¤¨¤ë¾ì¹ç */
29 * ʸ»úÎóÃæ¤Î¤¢¤ë¾ì½ê¤òɽ¤·¡¤
30 * ¤½¤³¤«¤é»Ï¤Þ¤ëmeta_word, word_list¤Î¥»¥Ã¥È¤ò»ý¤Ä
39 * ¥³¥ó¥Æ¥¥¹¥ÈÃæ¤Î¼«Î©¸ì¤Ê¤É¤Î¾ðÊ󡢺ǽé¤ËÊÑ´¹¥¡¼¤ò²¡¤·¤¿¤È¤¤Ë
42 struct word_split_info_cache {
43 struct char_node *cnode;
45 /* ¥¥ã¥Ã¥·¥å¹½À®»þ¤Ë»È¤¦¾ðÊó */
46 /* ÀÜÈø¼¤òõ¤¹¤Î¤Ë»È¤¦ */
47 int *seq_len;/* ¤½¤³¤«¤é»Ï¤Þ¤ëºÇŤÎñ¸ì¤ÎŤµ */
48 /* ÀÜƬ¼¤òõ¤¹¤Î¤Ë»È¤¦ */
49 int *rev_seq_len;/* ¤½¤³¤Ç½ª¤ï¤ëºÇŤÎñ¸ì¤ÎŤµ */
50 /* ʸÀᶳ¦context¤«¤é¤Î¥³¥Ô¡¼ */
52 /* ¸¡º÷¤Ç°ìÈÖÀ®ÀÓ¤ÎÎɤ«¤Ã¤¿¥¯¥é¥¹ */
53 enum seg_class* best_seg_class;
55 struct meta_word **best_mw;
57 allocator MwAllocator, WlAllocator;
65 /* mw->mw1¤ËÃæ¿È¤¬Æþ¤Ã¤Æ¤¤¤ë */
67 /* mw-mw1¤Èmw->mw2¤«¤éÏ¢·ë */
71 /* Ê£¹ç¸ì¤Î¸Ä¡¹¤ÎʸÀá¤ò·ë¹ç¤·¤Æ°ì¤Ä¤ÎʸÀá¤È¤·¤Æ¸«¤¿¤â¤Î */
72 MW_STATUS_COMPOUND_PART,
73 /* OCHAIRE³Ø½¬¤«¤é¼è¤ê½Ð¤¹ */
79 /* metaword¤Î¼ïÎà¤Ë¤è¤ë½èÍý¤Î°ã¤¤ (metaword.c) */
80 extern struct metaword_type_tab_ {
81 enum metaword_type type;
83 enum mw_status status;
85 } anthy_metaword_type_tab[];
95 #define PART_POSTFIX 2
96 #define PART_DEPWORD 3
111 * word_list: ʸÀá¤ò·ÁÀ®¤¹¤ë¤â¤Î
112 * ÀÜƬ¸ì¡¢¼«Î©¸ì¡¢ÀÜÈø¸ì¡¢ÉÕ°¸ì¤ò´Þ¤à
116 int from, len; /* ʸÀáÁ´ÂÎ */
117 int is_compound; /* Ê£¹ç¸ì¤«¤É¤¦¤« */
123 enum seg_class seg_class;
124 enum constraint_stat can_use; /* ¥»¥°¥á¥ó¥È¶³¦¤Ë¸Ù¤¬¤Ã¤Æ¤¤¤Ê¤¤ */
126 /* ´Á»ú¤òÆÀ¤ë¤¿¤á¤Ç¤Ï¤Ê¤¯¤Æ¡¢»¨Â¿¤Ê½èÍý¤Ë»È¤¤¤¿¤¤¾ðÊó */
127 int head_pos; /* lattice¸¡º÷ÍѤÎÉÊ»ì */
128 int tail_ct; /* meta_word¤Î·ë¹çÍѤγèÍÑ·Á */
132 struct part_info part[NR_PARTS];
134 /* ¤³¤Îword_list¤òºî¤Ã¤¿ºÝ¤Î¾ðÊó */
135 int node_id; /* ÉÕ°¸ì¥°¥é¥Õ¤Î¸¡º÷³«»Ï¤Înode¤Îid*/
137 /* Ʊ¤¸from¤ò»ý¤Äword_list¤Î¥ê¥¹¥È */
138 struct word_list *next;
143 #define SPLITTER_DEBUG_NONE 0
145 #define SPLITTER_DEBUG_WL 1
147 #define SPLITTER_DEBUG_MW 2
148 /* lattice¤Î node¤Îɽ¼¨ */
149 #define SPLITTER_DEBUG_LN 4
150 /* ¼«Î©¸ì¤Î¥Þ¥Ã¥Á¤·¤¿ÉÊ»ì */
151 #define SPLITTER_DEBUG_ID 8
153 #define SPLITTER_DEBUG_CAND 16
155 int anthy_splitter_debug_flags(void);
158 /* defined in wordseq.c */
159 /* ¼«Î©¸ì°Ê¹ß¤ÎÀܳ¤Î½èÍý */
160 void anthy_scan_node(struct splitter_context *sc,
161 struct word_list *wl,
162 xstr *follow, int node);
163 int anthy_get_node_id_by_name(const char *name);
164 int anthy_init_depword_tab(void);
165 void anthy_quit_depword_tab(void);
168 int anthy_get_nr_dep_rule(void);
169 void anthy_get_nth_dep_rule(int, struct wordseq_rule *);
171 /* defined in wordlist.c */
172 void anthy_commit_word_list(struct splitter_context *, struct word_list *wl);
173 struct word_list *anthy_alloc_word_list(struct splitter_context *);
174 void anthy_print_word_list(struct splitter_context *, struct word_list *);
175 void anthy_make_word_list_all(struct splitter_context *);
177 /* defined in metaword.c */
178 void anthy_commit_meta_word(struct splitter_context *, struct meta_word *mw);
179 void anthy_make_metaword_all(struct splitter_context *);
180 void anthy_print_metaword(struct splitter_context *, struct meta_word *);
182 void anthy_mark_border_by_metaword(struct splitter_context* sc,
183 struct meta_word* mw);
186 /* defined in evalborder.c */
187 void anthy_eval_border(struct splitter_context *, int, int, int);
189 /* defined at lattice.c */
190 void anthy_mark_borders(struct splitter_context *sc, int from, int to);
192 /* defined at seg_class.c */
193 void anthy_set_seg_class(struct word_list* wl);
195 /* ÉÊ»ì(anthy_init_splitter¤Ç½é´ü²½¤µ¤ì¤ë) */
196 extern wtype_t anthy_wtype_noun;
197 extern wtype_t anthy_wtype_name_noun;
198 extern wtype_t anthy_wtype_num_noun;
199 extern wtype_t anthy_wtype_prefix;
200 extern wtype_t anthy_wtype_num_prefix;
201 extern wtype_t anthy_wtype_num_postfix;
202 extern wtype_t anthy_wtype_name_postfix;
203 extern wtype_t anthy_wtype_sv_postfix;
204 extern wtype_t anthy_wtype_a_tail_of_v_renyou;
205 extern wtype_t anthy_wtype_v_renyou;
206 extern wtype_t anthy_wtype_noun_tail;/* ¤¤¤ì¡Ö¤¿¤Æ¡×¤È¤« */
207 extern wtype_t anthy_wtype_n1;
208 extern wtype_t anthy_wtype_n10;