1 #ifndef _main_h_included_
2 #define _main_h_included_
3 
4 #include <anthy/xstr.h>
5 #include <anthy/dic.h>
6 #include <anthy/splitter.h>
7 #include <anthy/segment.h>
8 #include <anthy/ordering.h>
9 #include <anthy/prediction.h>
10 
11 /*
12    予測変換の候補のキャッシュ
13  */
14 struct prediction_cache {
15   /* 予測元の文字列 */
16   xstr str;
17   /* 予測された候補の数 */
18   int nr_prediction;
19   /* 予測された候補 */
20   struct prediction_t* predictions;
21 };
22 
23 /** Anthyの変換コンテキスト
24  * 変換中の文字列などが入っている
25  */
26 struct anthy_context {
27   /** コンテキストの持つ文字列 */
28   xstr str;
29   /** 文節のリスト */
30   struct segment_list seg_list;
31   /** 辞書セッション */
32   dic_session_t dic_session;
33   /** splitterの情報 */
34   struct splitter_context split_info;
35   /** 候補の並び替え情報 */
36   struct ordering_context_wrapper ordering_info;
37   /** 予測候補 */
38   struct prediction_cache prediction;
39   /** エンコーディング */
40   int encoding;
41   /** 再変換のモード */
42   int reconversion_mode;
43 };
44 
45 
46 /* context.c */
47 void anthy_init_contexts(void);
48 void anthy_quit_contexts(void);
49 void anthy_init_personality(void);
50 void anthy_quit_personality(void);
51 int anthy_do_set_personality(const char *id);
52 struct anthy_context *anthy_do_create_context(int);
53 int anthy_do_context_set_str(struct anthy_context *c, xstr *x, int is_reverse);
54 void anthy_do_reset_context(struct anthy_context *c);
55 void anthy_do_release_context(struct anthy_context *c);
56 
57 void anthy_do_resize_segment(struct anthy_context *c,int nth,int resize);
58 
59 int anthy_do_set_prediction_str(struct anthy_context *c, xstr *x);
60 void anthy_release_segment_list(struct anthy_context *ac);
61 void anthy_save_history(const char *fn, struct anthy_context *ac);
62 
63 /* for debug */
64 void anthy_do_print_context(struct anthy_context *c, int encoding);
65 
66 
67 #endif
68 /* なるべく階層をフラットにするよろし */
69