MCPcopy Create free account
hub / github.com/SamuraiT/mecab-python3 / _wrap_Model_lookup

Function _wrap_Model_lookup

src/MeCab/MeCab_wrap.cpp:6501–6560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6499
6500
6501SWIGINTERN PyObject *_wrap_Model_lookup(PyObject *self, PyObject *args) {
6502 PyObject *resultobj = 0;
6503 MeCab::Model *arg1 = (MeCab::Model *) 0 ;
6504 char *arg2 = (char *) 0 ;
6505 char *arg3 = (char *) 0 ;
6506 MeCab::Lattice *arg4 = (MeCab::Lattice *) 0 ;
6507 void *argp1 = 0 ;
6508 int res1 = 0 ;
6509 int res2 ;
6510 char *buf2 = 0 ;
6511 int alloc2 = 0 ;
6512 int res3 ;
6513 char *buf3 = 0 ;
6514 int alloc3 = 0 ;
6515 void *argp4 = 0 ;
6516 int res4 = 0 ;
6517 PyObject *swig_obj[4] ;
6518 MeCab::Node *result = 0 ;
6519
6520 if (!SWIG_Python_UnpackTuple(args, "Model_lookup", 3, 3, swig_obj)) SWIG_fail;
6521 res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 );
6522 if (!SWIG_IsOK(res1)) {
6523 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_lookup" "', argument " "1"" of type '" "MeCab::Model const *""'");
6524 }
6525 arg1 = reinterpret_cast< MeCab::Model * >(argp1);
6526 res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2);
6527 if (!SWIG_IsOK(res2)) {
6528 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_lookup" "', argument " "2"" of type '" "char const *""'");
6529 }
6530 arg2 = reinterpret_cast< char * >(buf2);
6531 res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3);
6532 if (!SWIG_IsOK(res3)) {
6533 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Model_lookup" "', argument " "3"" of type '" "char const *""'");
6534 }
6535 arg3 = reinterpret_cast< char * >(buf3);
6536 res4 = SWIG_ConvertPtr(swig_obj[2], &argp4,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
6537 if (!SWIG_IsOK(res4)) {
6538 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Model_lookup" "', argument " "4"" of type '" "MeCab::Lattice *""'");
6539 }
6540 arg4 = reinterpret_cast< MeCab::Lattice * >(argp4);
6541 {
6542 try {
6543 result = (MeCab::Node *)((MeCab::Model const *)arg1)->lookup((char const *)arg2,(char const *)arg3,arg4);
6544 }
6545 catch (char *e) {
6546 SWIG_exception (SWIG_RuntimeError, e);
6547 }
6548 catch (const char *e) {
6549 SWIG_exception (SWIG_RuntimeError, (char*)e);
6550 }
6551 }
6552 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | 0 );
6553 if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6554 if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
6555 return resultobj;
6556fail:
6557 if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6558 if (alloc3 == SWIG_NEWOBJ) delete[] buf3;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected