Kouhei Sutou
kous****@users*****
2006年 12月 4日 (月) 13:36:48 JST
Index: tomoe/ext/ruby/tomoe-rb-dict.c diff -u tomoe/ext/ruby/tomoe-rb-dict.c:1.13 tomoe/ext/ruby/tomoe-rb-dict.c:1.14 --- tomoe/ext/ruby/tomoe-rb-dict.c:1.13 Mon Dec 4 00:04:42 2006 +++ tomoe/ext/ruby/tomoe-rb-dict.c Mon Dec 4 13:36:47 2006 @@ -46,13 +46,7 @@ "editable", RVAL2CBOOL(editable), NULL); } else if (strcmp(name, "unihan") == 0) { - VALUE rb_dict_name; - gchar *dict_name; - - rb_dict_name = rb_hash_aref(props, CSTR2RVAL("name")); - dict_name = NIL_P(rb_dict_name) ? NULL : RVAL2CSTR(rb_dict_name); - - dict = tomoe_dict_new(name, "name", dict_name, NULL); + dict = tomoe_dict_new(name, NULL); } else { rb_raise(rb_eArgError, "unknown dictionary type: %s", name); dict = NULL; Index: tomoe/ext/ruby/tomoe-rb-recognizer.c diff -u tomoe/ext/ruby/tomoe-rb-recognizer.c:1.3 tomoe/ext/ruby/tomoe-rb-recognizer.c:1.4 --- tomoe/ext/ruby/tomoe-rb-recognizer.c:1.3 Wed Nov 29 11:53:11 2006 +++ tomoe/ext/ruby/tomoe-rb-recognizer.c Mon Dec 4 13:36:47 2006 @@ -15,9 +15,17 @@ } static VALUE -tr_s_new(VALUE self, VALUE name) +tr_s_new(int argc, VALUE *argv, VALUE self) { - return GOBJ2RVAL(tomoe_recognizer_new(RVAL2CSTR(name), NULL)); + TomoeRecognizer *recognizer; + VALUE name, dict; + + rb_scan_args(argc, argv, "11", &name, &dict); + + recognizer = tomoe_recognizer_new(RVAL2CSTR(name), + "dictionary", RVAL2TDIC(dict), + NULL); + return GOBJ2RVAL(recognizer); } void @@ -30,5 +38,5 @@ rb_define_singleton_method(cTomoeRecognizer, "load", tr_s_load, 1); rb_define_singleton_method(cTomoeRecognizer, "unload", tr_s_unload, 0); - rb_define_singleton_method(cTomoeRecognizer, "new", tr_s_new, 1); + rb_define_singleton_method(cTomoeRecognizer, "new", tr_s_new, -1); }