1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12: #ifndef _anthy_h_included_
13: #define _anthy_h_included_
14:
15: #ifdef __cplusplus
16: extern "C" {
17: #endif
18:
19:
20:
21: struct anthy_conv_stat {
22: int nr_segment;
23: };
24:
25: struct anthy_segment_stat {
26: int nr_candidate;
27: int seg_len;
28: };
29:
30: struct anthy_prediction_stat {
31: int nr_prediction;
32: };
33:
34: typedef struct anthy_context *anthy_context_t;
35:
36:
37:
38:
39: #define NTH_UNCONVERTED_CANDIDATE -1
40: #define NTH_KATAKANA_CANDIDATE -2
41: #define NTH_HIRAGANA_CANDIDATE -3
42: #define NTH_HALFKANA_CANDIDATE -4
43:
44: #define ANTHY_COMPILED_ENCODING 0
45: #define ANTHY_EUC_JP_ENCODING 1
46: #define ANTHY_UTF8_ENCODING 2
47:
48: #define ANTHY_RECONVERT_AUTO 0
49: #define ANTHY_RECONVERT_DISABLE 1
50: #define ANTHY_RECONVERT_ALWAYS 2
51:
52:
53: extern int anthy_init(void);
54: extern void anthy_quit(void);
55: extern void anthy_conf_override(const char *, const char *);
56: extern int anthy_set_personality(const char *);
57:
58:
59:
60:
61: extern anthy_context_t anthy_create_context(void);
62: extern void anthy_reset_context(anthy_context_t);
63: extern void anthy_release_context(anthy_context_t);
64:
65:
66:
67:
68: extern int anthy_set_string(anthy_context_t, const char *);
69:
70: extern void anthy_resize_segment(anthy_context_t, int, int);
71: extern int anthy_get_stat(anthy_context_t, struct anthy_conv_stat *);
72: extern int anthy_get_segment_stat(anthy_context_t, int, struct anthy_segment_stat *);
73:
74: extern int anthy_get_segment(anthy_context_t, int, int, char *, int);
75:
76: extern int anthy_commit_segment(anthy_context_t, int, int);
77:
78:
79: #define HAS_ANTHY_PREDICTION
80: extern int anthy_set_prediction_string(anthy_context_t, const char*);
81: extern int anthy_get_prediction_stat(anthy_context_t, struct anthy_prediction_stat *);
82:
83: extern int anthy_get_prediction(anthy_context_t, int, char*, int);
84: #define HAS_ANTHY_COMMIT_PREDICTION
85: extern int anthy_commit_prediction(anthy_context_t, int);
86:
87:
88: extern void anthy_print_context(anthy_context_t);
89:
90: extern const char *anthy_get_version_string (void);
91: typedef void (*anthy_logger)(int level, const char *);
92: extern void anthy_set_logger(anthy_logger , int level);
93:
94:
95: #define HAS_ANTHY_CONTEXT_SET_ENCODING
96: extern int anthy_context_set_encoding(anthy_context_t ac, int encoding);
97: #define HAS_ANTHY_SET_RECONVERSION_MODE
98: extern int anthy_set_reconversion_mode(anthy_context_t ac, int mode);
99:
100: #ifdef __cplusplus
101: }
102: #endif
103:
104: #endif