Class: Mykytea::Kytea

Inherits:
Object
  • Object
show all
Defined in:
ext/mykytea_wrap.cxx

Instance Method Summary collapse

Constructor Details

#initialize(*args, self) ⇒ Object



16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
# File 'ext/mykytea_wrap.cxx', line 16649

SWIGINTERN VALUE _wrap_new_Kytea(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[1];
  int ii;
  
  argc = nargs;
  if (argc > 1) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 0) {
    return _wrap_new_Kytea__SWIG_0(nargs, args, self);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_kytea__KyteaConfig, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Kytea__SWIG_1(nargs, args, self);
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 1, "Kytea.new", 
    "    Kytea.new()\n"
    "    Kytea.new(kytea::KyteaConfig *config)\n");
  
  return Qnil;
}

Instance Method Details

#analyze(*args) ⇒ Object



16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
# File 'ext/mykytea_wrap.cxx', line 16522

SWIGINTERN VALUE
_wrap_Kytea_analyze(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","analyze", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  {
    try{
      (arg1)->analyze();
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#calculateTags(*args) ⇒ Object



16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
# File 'ext/mykytea_wrap.cxx', line 16333

SWIGINTERN VALUE
_wrap_Kytea_calculateTags(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  KyteaSentence *arg2 = 0 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","calculateTags", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_kytea__KyteaSentence,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "KyteaSentence &","calculateTags", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "KyteaSentence &","calculateTags", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< KyteaSentence * >(argp2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","calculateTags", 3, argv[1] ));
  } 
  arg3 = static_cast< int >(val3);
  {
    try{
      (arg1)->calculateTags(*arg2,arg3);
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#calculateUnknownTag(*args) ⇒ Object



16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
# File 'ext/mykytea_wrap.cxx', line 16381

SWIGINTERN VALUE
_wrap_Kytea_calculateUnknownTag(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  KyteaWord *arg2 = 0 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","calculateUnknownTag", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_kytea__KyteaWord,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "KyteaWord &","calculateUnknownTag", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "KyteaWord &","calculateUnknownTag", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< KyteaWord * >(argp2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","calculateUnknownTag", 3, argv[1] ));
  } 
  arg3 = static_cast< int >(val3);
  {
    try{
      (arg1)->calculateUnknownTag(*arg2,arg3);
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#calculateWS(*args) ⇒ Object



16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
# File 'ext/mykytea_wrap.cxx', line 16293

SWIGINTERN VALUE
_wrap_Kytea_calculateWS(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  KyteaSentence *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","calculateWS", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_kytea__KyteaSentence,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "KyteaSentence &","calculateWS", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "KyteaSentence &","calculateWS", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< KyteaSentence * >(argp2);
  {
    try{
      (arg1)->calculateWS(*arg2);
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#checkEqual(*args) ⇒ Object



16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
# File 'ext/mykytea_wrap.cxx', line 16756

SWIGINTERN VALUE
_wrap_Kytea_checkEqual(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  kytea::Kytea *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","checkEqual", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_kytea__Kytea,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "kytea::Kytea const &","checkEqual", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "kytea::Kytea const &","checkEqual", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< kytea::Kytea * >(argp2);
  {
    try{
      (arg1)->checkEqual((kytea::Kytea const &)*arg2);
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#getConfig(*args) ⇒ Object



16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
# File 'ext/mykytea_wrap.cxx', line 16461

SWIGINTERN VALUE
_wrap_Kytea_getConfig(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  kytea::KyteaConfig *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","getConfig", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  {
    try{
      result = (kytea::KyteaConfig *)(arg1)->getConfig();
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_kytea__KyteaConfig, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}

#getStringUtil(*args) ⇒ Object



16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
# File 'ext/mykytea_wrap.cxx', line 16429

SWIGINTERN VALUE
_wrap_Kytea_getStringUtil(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  kytea::StringUtil *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","getStringUtil", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  {
    try{
      result = (kytea::StringUtil *)(arg1)->getStringUtil();
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_kytea__StringUtil, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}

#getWSModel(*args) ⇒ Object



16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
# File 'ext/mykytea_wrap.cxx', line 16687

SWIGINTERN VALUE
_wrap_Kytea_getWSModel(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  kytea::KyteaModel *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","getWSModel", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  {
    try{
      result = (kytea::KyteaModel *)(arg1)->getWSModel();
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_kytea__KyteaModel, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}

#init(*args) ⇒ Object



16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
# File 'ext/mykytea_wrap.cxx', line 16551

SWIGINTERN VALUE
_wrap_Kytea_init(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","init", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  {
    try{
      (arg1)->init();
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#readModel(*args) ⇒ Object



16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
# File 'ext/mykytea_wrap.cxx', line 16213

SWIGINTERN VALUE
_wrap_Kytea_readModel(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","readModel", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","readModel", 2, argv[0] ));
  }
  arg2 = reinterpret_cast< char * >(buf2);
  {
    try{
      (arg1)->readModel((char const *)arg2);
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return Qnil;
}

#setWSModel(*args) ⇒ Object



16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
# File 'ext/mykytea_wrap.cxx', line 16719

SWIGINTERN VALUE
_wrap_Kytea_setWSModel(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  kytea::KyteaModel *arg2 = (kytea::KyteaModel *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","setWSModel", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_kytea__KyteaModel, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "kytea::KyteaModel *","setWSModel", 2, argv[0] )); 
  }
  arg2 = reinterpret_cast< kytea::KyteaModel * >(argp2);
  {
    try{
      (arg1)->setWSModel(arg2);
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#trainAll(*args) ⇒ Object



16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
# File 'ext/mykytea_wrap.cxx', line 16493

SWIGINTERN VALUE
_wrap_Kytea_trainAll(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","trainAll", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  {
    try{
      (arg1)->trainAll();
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#writeModel(*args) ⇒ Object



16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
# File 'ext/mykytea_wrap.cxx', line 16253

SWIGINTERN VALUE
_wrap_Kytea_writeModel(int argc, VALUE *argv, VALUE self) {
  kytea::Kytea *arg1 = (kytea::Kytea *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_kytea__Kytea, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "kytea::Kytea *","writeModel", 1, self )); 
  }
  arg1 = reinterpret_cast< kytea::Kytea * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","writeModel", 2, argv[0] ));
  }
  arg2 = reinterpret_cast< char * >(buf2);
  {
    try{
      (arg1)->writeModel((char const *)arg2);
    } catch (const std::exception &e){
      SWIG_exception(SWIG_RuntimeError, e.what() );
    } catch (...) {
      SWIG_exception(SWIG_UnknownError, "Unknown exception");
    }
  }
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return Qnil;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return Qnil;
}