5 * Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307 USA
24 /* Put header files here or function declarations like below */
25 #include <anthy/anthy.h>
33 %include anthy/anthy.h
34 struct anthy_context {};
35 %extend anthy_context {
37 return anthy_create_context ();
41 anthy_reset_context (self);
44 int set_string (char *str) {
45 return anthy_set_string (self, str);
48 void resize_segment (int a1, int a2) {
49 anthy_resize_segment (self, a1, a2);
52 int get_stat (struct anthy_conv_stat *a1) {
53 return anthy_get_stat (self, a1);
56 int get_segment_stat (int a1, struct anthy_segment_stat *a2) {
57 return anthy_get_segment_stat (self, a1, a2);
60 char *get_segment (int a1, int a2) {
62 static char temp[512];
64 len = anthy_get_segment (self, a1, a2, temp, sizeof (temp));
71 int commit_segment (int a1, int a2) {
72 return anthy_commit_segment (self, a1, a2);
75 int set_prediction_string (const char *a1) {
76 return anthy_set_prediction_string (self, a1);
79 int get_prediction_stat (struct anthy_prediction_stat *a1) {
80 return anthy_get_prediction_stat (self, a1);
83 char *get_prediction (int a1) {
85 static char temp[512];
87 len = anthy_get_prediction (self, a1, temp, sizeof (temp));
95 int commit_prediction (int a1) {
96 return anthy_commit_prediction(self, a1);
100 anthy_print_context (self);
103 int _set_encoding (int encoding) {
104 return anthy_context_set_encoding (self, encoding);
107 int set_reconversion_mode (int mode) {
108 return anthy_set_reconversion_mode (self, mode);
112 anthy_release_context (self);