diff --git a/mecab/python/MeCab.i b/mecab/python/MeCab.i new file mode 100644 index 0000000..5fe9381 --- /dev/null +++ b/mecab/python/MeCab.i @@ -0,0 +1,160 @@ +%module MeCab +%include exception.i +%{ +#include "mecab.h" + +/* Workaround for ruby1.9.x */ +#if defined SWIGRUBY +#include "ruby/version.h" +#if RUBY_API_VERSION_CODE >= 10900 +#include "ruby/encoding.h" +#define rb_str_new rb_external_str_new +#endif +#endif +%} + +%newobject surface; + +%exception { + try { $action } + catch (char *e) { SWIG_exception (SWIG_RuntimeError, e); } + catch (const char *e) { SWIG_exception (SWIG_RuntimeError, (char*)e); } +} + +%rename(Node) mecab_node_t; +%rename(Path) mecab_path_t; +%rename(DictionaryInfo) mecab_dictionary_info_t; +%ignore mecab_model_t; +%ignore mecab_lattice_t; +%nodefault mecab_path_t; +%nodefault mecab_node_t; + +%feature("notabstract") MeCab::Tagger; +%feature("notabstract") MeCab::Lattice; +%feature("notabstract") MeCab::Model; + +%immutable mecab_dictionary_info_t::filename; +%immutable mecab_dictionary_info_t::charset; +%immutable mecab_dictionary_info_t::size; +%immutable mecab_dictionary_info_t::lsize; +%immutable mecab_dictionary_info_t::rsize; +%immutable mecab_dictionary_info_t::type; +%immutable mecab_dictionary_info_t::version; +%immutable mecab_dictionary_info_t::next; + +%immutable mecab_path_t::rnode; +%immutable mecab_path_t::lnode; +%immutable mecab_path_t::rnext; +%immutable mecab_path_t::lnext; +%immutable mecab_path_t::cost; + +%immutable mecab_node_t::prev; +%immutable mecab_node_t::next; +%immutable mecab_node_t::enext; +%immutable mecab_node_t::bnext; +%immutable mecab_node_t::lpath; +%immutable mecab_node_t::rpath; +%immutable mecab_node_t::feature; +%immutable mecab_node_t::length; +%immutable mecab_node_t::rlength; +%immutable mecab_node_t::id; +%immutable mecab_node_t::rcAttr; +%immutable mecab_node_t::lcAttr; +%immutable mecab_node_t::posid; +%immutable mecab_node_t::char_type; +%immutable mecab_node_t::stat; +%immutable mecab_node_t::isbest; +%immutable mecab_node_t::alpha; +%immutable mecab_node_t::beta; +%immutable mecab_node_t::wcost; +%immutable mecab_node_t::cost; +%immutable mecab_node_t::surface; + +%extend mecab_node_t { + char *surface; +} + +%extend MeCab::Tagger { + Tagger(const char *argc); + Tagger(); + const char* parseToString(const char* str, size_t length = 0) { + return self->parse(str, length); + } +} + +%extend MeCab::Model { + Model(const char *argc); + Model(); +} + +%extend MeCab::Lattice { + Lattice(); + void set_sentence(const char *sentence) { + self->add_request_type(MECAB_ALLOCATE_SENTENCE); + self->set_sentence(sentence); + } +} + +%{ + +MeCab::Tagger* new_MeCab_Tagger (const char *arg) { + char *p = new char [strlen(arg) + 4]; + strcpy(p, "-C "); + strcat(p, arg); + MeCab::Tagger *tagger = MeCab::createTagger(p); + delete [] p; + if (! tagger) throw MeCab::getLastError(); + return tagger; +} + +MeCab::Tagger* new_MeCab_Tagger () { + MeCab::Tagger *tagger = MeCab::createTagger("-C"); + if (! tagger) throw MeCab::getLastError(); + return tagger; +} + +void delete_MeCab_Tagger (MeCab::Tagger *t) { + delete t; + t = 0; +} + +MeCab::Model* new_MeCab_Model (const char *arg) { + char *p = new char [strlen(arg) + 4]; + strcpy(p, "-C "); + strcat(p, arg); + MeCab::Model *model = MeCab::createModel(p); + delete [] p; + if (! model) throw MeCab::getLastError(); + return model; +} + +MeCab::Model* new_MeCab_Model () { + MeCab::Model *model = MeCab::createModel("-C"); + if (! model) throw MeCab::getLastError(); + return model; +} + +void delete_MeCab_Model (MeCab::Model *t) { + delete t; + t = 0; +} + +MeCab::Lattice* new_MeCab_Lattice () { + return MeCab::createLattice(); +} + +void delete_MeCab_Lattice (MeCab::Lattice *t) { + delete t; + t = 0; +} + +char* mecab_node_t_surface_get(mecab_node_t *n) { + char *s = new char [n->length + 1]; + memcpy (s, n->surface, n->length); + s[n->length] = '\0'; + return s; +} +%} + +%include mecab.h +%include version.h diff --git a/mecab/python/MeCab_wrap.cxx b/mecab/python/MeCab_wrap.cxx index 2513e7c..aafcc1a 100644 --- a/mecab/python/MeCab_wrap.cxx +++ b/mecab/python/MeCab_wrap.cxx @@ -1,14 +1,19 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * This file is not intended to be easily readable and contains a number of + * Version 3.0.12 + * + * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. * ----------------------------------------------------------------------------- */ + +#ifndef SWIGPYTHON #define SWIGPYTHON +#endif + +#define SWIG_PYTHON_NO_BUILD_NONE #define SWIG_PYTHON_DIRECTOR_NO_VTABLE @@ -66,28 +71,28 @@ template T SwigValueInit() { #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) +# define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) +# define SWIGUNUSED __attribute__ ((__unused__)) # else -# define SWIGUNUSED +# define SWIGUNUSED # endif #endif #ifndef SWIG_MSC_UNSUPPRESS_4505 # if defined(_MSC_VER) # pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif +# endif #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif @@ -102,9 +107,11 @@ template T SwigValueInit() { #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -130,7 +137,7 @@ template T SwigValueInit() { # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL -# endif +# endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ @@ -143,10 +150,29 @@ template T SwigValueInit() { # define _SCL_SECURE_NO_DEPRECATE #endif +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif -/* Python.h has to appear first */ -#include +#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) +/* Use debug wrappers with the Python release dll */ +# undef _DEBUG +# include +# define _DEBUG +#else +# include +#endif /* ----------------------------------------------------------------------------- * swigrun.swg @@ -172,7 +198,7 @@ template T SwigValueInit() { You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for creating a static or dynamic library from the SWIG runtime code. In 99.9% of the cases, SWIG just needs to declare them as 'static'. - + But only do this if strictly necessary, ie, if you have problems with your compiler or suchlike. */ @@ -198,16 +224,16 @@ template T SwigValueInit() { #define SWIG_POINTER_OWN 0x1 -/* +/* Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer + + The SWIG conversion methods, as ConvertPtr, return an integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). - + Use the following macros/flags to set or process the returning states. - + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { @@ -240,23 +266,23 @@ template T SwigValueInit() { } else { // fail code } - + I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that also requires SWIG_ConvertPtr to return new result values, such as - int SWIG_ConvertPtr(obj, ptr,...) { - if () { - if () { - *ptr = ; - return SWIG_NEWOBJ; - } else { - *ptr = ; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } } Of course, returning the plain '0(success)/-1(fail)' still works, but you can be @@ -270,17 +296,17 @@ template T SwigValueInit() { int fooi(int); and you call - + food(1) // cast rank '1' (1 -> 1.0) fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() */ -#define SWIG_OK (0) +#define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) /* The CastRankLimit says how many bits are used for the cast rank */ #define SWIG_CASTRANKLIMIT (1 << 8) @@ -311,14 +337,14 @@ template T SwigValueInit() { # endif # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { +SWIGINTERNINLINE int SWIG_AddCast(int r) { return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; } -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; } #else /* no cast-rank mode */ -# define SWIG_AddCast +# define SWIG_AddCast(r) (r) # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif @@ -362,7 +388,7 @@ typedef struct swig_module_info { void *clientdata; /* Language specific module data */ } swig_module_info; -/* +/* Compare two type names skipping the space characters, therefore "char*" == "char *" and "Class" == "Class", etc. @@ -382,18 +408,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1, /* Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal + Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - int equiv = 0; +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; const char* te = tb + strlen(tb); const char* ne = nb; - while (!equiv && *ne) { + while (equiv != 0 && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + equiv = SWIG_TypeNameComp(nb, ne, tb, te); if (*ne) ++ne; } return equiv; @@ -401,24 +427,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) { /* Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb + Return 0 if not equal, 1 if equal */ SWIGRUNTIME int -SWIG_TypeCompare(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; - } - return equiv; +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; } - /* Check the typename */ @@ -446,7 +461,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { return 0; } -/* +/* Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * @@ -481,7 +496,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } -/* +/* Dynamic pointer casting. Down an inheritance hierarchy */ SWIGRUNTIME swig_type_info * @@ -525,7 +540,7 @@ SWIG_TypePrettyName(const swig_type_info *type) { return type->name; } -/* +/* Set the clientdata field for a type */ SWIGRUNTIME void @@ -533,14 +548,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { swig_cast_info *cast = ti->cast; /* if (ti->clientdata == clientdata) return; */ ti->clientdata = clientdata; - + while (cast) { if (!cast->converter) { swig_type_info *tc = cast->type; if (!tc->clientdata) { SWIG_TypeClientData(tc, clientdata); } - } + } cast = cast->next; } } @@ -549,31 +564,31 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { SWIG_TypeClientData(ti, clientdata); ti->owndata = 1; } - + /* Search for a swig_type_info structure only by mangled name Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. + + We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, const char *name) { swig_module_info *iter = start; do { if (iter->size) { - register size_t l = 0; - register size_t r = iter->size - 1; + size_t l = 0; + size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; + size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { - register int compare = strcmp(name, iname); - if (compare == 0) { + int compare = strcmp(name, iname); + if (compare == 0) { return iter->types[i]; } else if (compare < 0) { if (i) { @@ -598,14 +613,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start, Search for a swig_type_info structure for either a mangled name or a human readable name. It first searches the mangled names of the types, which is a O(log #types) If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. + + We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, const char *name) { /* STEP 1: Search the name field using binary search */ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); @@ -616,7 +631,7 @@ SWIG_TypeQueryModule(swig_module_info *start, of the str field (the human readable name) */ swig_module_info *iter = start; do { - register size_t i = 0; + size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; @@ -624,56 +639,56 @@ SWIG_TypeQueryModule(swig_module_info *start, iter = iter->next; } while (iter != end); } - + /* neither found a match */ return 0; } -/* +/* Pack binary data into a string */ SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; - register const unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register unsigned char uu = *u; + unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } -/* +/* Unpack binary data from a string */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - register unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu; + char d = *(c++); + unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else + uu = (unsigned char)((d - ('a'-10)) << 4); + else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else + uu |= (unsigned char)(d - ('a'-10)); + else return (char *) 0; *u = uu; } return c; } -/* +/* Pack 'void *' into a string buffer. */ SWIGRUNTIME char * @@ -733,18 +748,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #endif /* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 #define SWIG_SystemError -10 #define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 +#define SWIG_MemoryError -12 #define SWIG_NullReferenceError -13 @@ -756,6 +771,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #define PyInt_Check(x) PyLong_Check(x) #define PyInt_AsLong(x) PyLong_AsLong(x) #define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyInt_FromSize_t(x) PyLong_FromSize_t(x) #define PyString_Check(name) PyBytes_Check(name) #define PyString_FromString(x) PyUnicode_FromString(x) #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) @@ -847,10 +863,6 @@ PyString_FromFormat(const char *fmt, ...) { } #endif -/* Add PyObject_Del for old Pythons */ -#if PY_VERSION_HEX < 0x01060000 -# define PyObject_Del(op) PyMem_DEL((op)) -#endif #ifndef PyObject_DEL # define PyObject_DEL PyObject_Del #endif @@ -925,6 +937,10 @@ static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) } #endif +#if PY_VERSION_HEX < 0x02050000 +#define PyInt_FromSize_t(x) PyInt_FromLong((long)x) +#endif + #if PY_VERSION_HEX < 0x02040000 #define Py_VISIT(op) \ do { \ @@ -961,6 +977,7 @@ typedef destructor freefunc; #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) +#define Py_hash_t long #endif /* ----------------------------------------------------------------------------- @@ -1196,7 +1213,7 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), /* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule() +#define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) #define SWIG_NewClientData(obj) SwigPyClientData_New(obj) @@ -1222,7 +1239,7 @@ SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, (char *) msg); + PyErr_SetString(errtype, msg); SWIG_PYTHON_THREAD_END_BLOCK; } @@ -1241,7 +1258,11 @@ SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif Py_DECREF(obj); if (public_interface) SwigPyBuiltin_AddPublicSymbol(public_interface, name); @@ -1251,7 +1272,11 @@ SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *nam SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { +#if PY_VERSION_HEX < 0x02030000 PyDict_SetItemString(d, (char *)name, obj); +#else + PyDict_SetItemString(d, name, obj); +#endif Py_DECREF(obj); } @@ -1304,7 +1329,7 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { /* Unpack the argument tuple */ -SWIGINTERN int +SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) { if (!args) { @@ -1318,7 +1343,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } if (!PyTuple_Check(args)) { if (min <= 1 && max >= 1) { - register int i; + Py_ssize_t i; objs[0] = args; for (i = 1; i < max; ++i) { objs[i] = 0; @@ -1328,7 +1353,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); return 0; } else { - register Py_ssize_t l = PyTuple_GET_SIZE(args); + Py_ssize_t l = PyTuple_GET_SIZE(args); if (l < min) { PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", name, (min == max ? "" : "at least "), (int)min, (int)l); @@ -1338,7 +1363,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi name, (min == max ? "" : "at most "), (int)max, (int)l); return 0; } else { - register int i; + Py_ssize_t i; for (i = 0; i < l; ++i) { objs[i] = PyTuple_GET_ITEM(args, i); } @@ -1524,6 +1549,23 @@ typedef struct { #endif } SwigPyObject; + +#ifdef SWIGPYTHON_BUILTIN + +SWIGRUNTIME PyObject * +SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) +{ + SwigPyObject *sobj = (SwigPyObject *)v; + + if (!sobj->dict) + sobj->dict = PyDict_New(); + + Py_INCREF(sobj->dict); + return sobj->dict; +} + +#endif + SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v) { @@ -1572,7 +1614,7 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *repr = SWIG_Python_str_FromFormat("", name, (void *)v); + PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); if (v->next) { # ifdef METH_NOARGS PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); @@ -1591,34 +1633,6 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args) return repr; } -SWIGRUNTIME int -SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char *str; -#ifdef METH_NOARGS - PyObject *repr = SwigPyObject_repr(v); -#else - PyObject *repr = SwigPyObject_repr(v, NULL); -#endif - if (repr) { - str = SWIG_Python_str_AsChar(repr); - fputs(str, fp); - SWIG_Python_str_DelForPy3(str); - Py_DECREF(repr); - return 0; - } else { - return 1; - } -} - -SWIGRUNTIME PyObject * -SwigPyObject_str(SwigPyObject *v) -{ - char result[SWIG_BUFFER_SIZE]; - return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - SWIG_Python_str_FromChar(result) : 0; -} - SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { @@ -1690,16 +1704,32 @@ SwigPyObject_dealloc(PyObject *v) if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; + + /* PyObject_CallFunction() has the potential to silently drop + the active active exception. In cases of unnamed temporary + variable or where we just finished iterating over a generator + StopIteration will be active right now, and this needs to + remain true upon return from SwigPyObject_dealloc. So save + and restore. */ + + PyObject *val = NULL, *type = NULL, *tb = NULL; + PyErr_Fetch(&val, &type, &tb); + if (data->delargs) { - /* we need to create a temporary object to carry the destroy operation */ - PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); - res = SWIG_Python_CallFunctor(destroy, tmp); - Py_DECREF(tmp); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); + res = SWIG_Python_CallFunctor(destroy, tmp); + Py_DECREF(tmp); } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject *mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); } + if (!res) + PyErr_WriteUnraisable(destroy); + + PyErr_Restore(val, type, tb); + Py_XDECREF(res); } #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) @@ -1723,6 +1753,7 @@ SwigPyObject_append(PyObject* v, PyObject* next) next = tmp; #endif if (!SwigPyObject_Check(next)) { + PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); return NULL; } sobj->next = next; @@ -1776,8 +1807,10 @@ SwigPyObject_own(PyObject *v, PyObject *args) PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#else +#elif (PY_VERSION_HEX < 0x02050000) if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) +#else + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) #endif { return NULL; @@ -1809,7 +1842,7 @@ SwigPyObject_own(PyObject *v, PyObject *args) static PyMethodDef swigobject_methods[] = { {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, @@ -1820,7 +1853,7 @@ swigobject_methods[] = { static PyMethodDef swigobject_methods[] = { {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"}, {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, @@ -1876,7 +1909,9 @@ SwigPyObject_TypeOnce(void) { (unaryfunc)SwigPyObject_oct, /*nb_oct*/ (unaryfunc)SwigPyObject_hex, /*nb_hex*/ #endif -#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ +#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ +#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ @@ -1891,7 +1926,6 @@ SwigPyObject_TypeOnce(void) { static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { - /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else @@ -1902,7 +1936,7 @@ SwigPyObject_TypeOnce(void) { sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ - (printfunc)SwigPyObject_print, /* tp_print */ + 0, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else @@ -1910,7 +1944,7 @@ SwigPyObject_TypeOnce(void) { #endif (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 - 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ #else (cmpfunc)SwigPyObject_compare, /* tp_compare */ #endif @@ -1920,7 +1954,7 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyObject_str, /* tp_str */ + 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1956,10 +1990,19 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ #endif }; swigpyobject_type = tmp; @@ -2074,7 +2117,6 @@ SwigPyPacked_TypeOnce(void) { static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { - /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX>=0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else @@ -2135,10 +2177,19 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ #endif }; swigpypacked_type = tmp; @@ -2297,10 +2348,11 @@ SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { int res; SwigPyObject *sobj; + int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; if (!obj) return SWIG_ERROR; - if (obj == Py_None) { + if (obj == Py_None && !implicit_conv) { if (ptr) *ptr = 0; return SWIG_OK; @@ -2349,7 +2401,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } res = SWIG_OK; } else { - if (flags & SWIG_POINTER_IMPLICIT_CONV) { + if (implicit_conv) { SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; @@ -2384,6 +2436,13 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } } + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } } return res; } @@ -2471,24 +2530,30 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) } } else { #if PY_VERSION_HEX >= 0x03000000 - inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); - PyObject_SetAttr(inst, SWIG_This(), swig_this); - Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + if (inst) { + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } #else PyObject *dict = PyDict_New(); - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } #endif } return inst; #else #if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst; + PyObject *inst = 0; PyObject *dict = PyDict_New(); - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); + if (dict) { + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } return (PyObject *) inst; #else PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); @@ -2539,7 +2604,7 @@ SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args) { PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { + if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { return NULL; } else { SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); @@ -2575,18 +2640,21 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f newobj = (SwigPyObject *) newobj->next; newobj->next = next_self; newobj = (SwigPyObject *)next_self; +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif } } else { newobj = PyObject_New(SwigPyObject, clientdata->pytype); +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif } if (newobj) { newobj->ptr = ptr; newobj->ty = type; newobj->own = own; newobj->next = 0; -#ifdef SWIGPYTHON_BUILTIN - newobj->dict = 0; -#endif return (PyObject*) newobj; } return SWIG_Py_Void(); @@ -2595,12 +2663,10 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f assert(!(flags & SWIG_BUILTIN_TP_INIT)); robj = SwigPyObject_New(ptr, type, own); - if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { + if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - if (inst) { - Py_DECREF(robj); - robj = inst; - } + Py_DECREF(robj); + robj = inst; } return robj; } @@ -2621,7 +2687,7 @@ void *SWIG_ReturnGlobalTypeList(void *); #endif SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void) { +SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { static void *type_pointer = (void *)0; /* first check if module already created */ if (!type_pointer) { @@ -2651,13 +2717,11 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o) { PyObject *dict; if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, - "PyModule_AddObject() needs module as first arg"); + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); return SWIG_ERROR; } if (!o) { - PyErr_SetString(PyExc_TypeError, - "PyModule_AddObject() needs non-NULL value"); + PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); return SWIG_ERROR; } @@ -2747,7 +2811,7 @@ SWIG_Python_TypeQuery(const char *type) descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); #endif } else { - swig_module_info *swig_module = SWIG_Python_GetModule(); + swig_module_info *swig_module = SWIG_GetModule(0); descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); if (descriptor) { #ifdef SWIGPY_USE_CAPSULE @@ -2815,7 +2879,7 @@ SwigPyObject_GetDesc(PyObject *self) { SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : (char*)""; + return ty ? ty->str : ""; } SWIGRUNTIME void @@ -2872,23 +2936,24 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(arg return result; } +#ifdef SWIGPYTHON_BUILTIN SWIGRUNTIME int SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { PyTypeObject *tp = obj->ob_type; PyObject *descr; PyObject *encoded_name; descrsetfunc f; - int res; + int res = -1; -#ifdef Py_USING_UNICODE +# ifdef Py_USING_UNICODE if (PyString_Check(name)) { name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); if (!name) return -1; } else if (!PyUnicode_Check(name)) -#else +# else if (!PyString_Check(name)) -#endif +# endif { PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); return -1; @@ -2901,7 +2966,6 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { goto done; } - res = -1; descr = _PyType_Lookup(tp, name); f = NULL; if (descr != NULL) @@ -2923,6 +2987,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { Py_DECREF(name); return res; } +#endif #ifdef __cplusplus @@ -2950,9 +3015,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { #define SWIGTYPE_p_mecab_node_t swig_types[5] #define SWIGTYPE_p_mecab_path_t swig_types[6] #define SWIGTYPE_p_mecab_t swig_types[7] -#define SWIGTYPE_p_p_char swig_types[8] -static swig_type_info *swig_types[10]; -static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; +static swig_type_info *swig_types[9]; +static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -2963,6 +3027,19 @@ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; # error "This python version requires swig to be run with the '-classic' option" # endif #endif +#if (PY_VERSION_HEX <= 0x02020000) +# error "This python version requires swig to be run with the '-nomodern' option" +#endif +#if (PY_VERSION_HEX <= 0x02020000) +# error "This python version requires swig to be run with the '-nomodernargs' option" +#endif +#ifndef METH_O +# error "This python version requires swig to be run with the '-nofastunpack' option" +#endif +#ifdef SWIG_TypeQuery +# undef SWIG_TypeQuery +#endif +#define SWIG_TypeQuery SWIG_Python_TypeQuery /*----------------------------------------------- @(target):= _MeCab.so @@ -2976,7 +3053,7 @@ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; #endif #define SWIG_name "_MeCab" -#define SWIGVERSION 0x020004 +#define SWIGVERSION 0x030012 #define SWIG_VERSION SWIGVERSION @@ -2999,27 +3076,35 @@ namespace swig { SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_XINCREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; } SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_XINCREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; } } SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_XINCREF(item._obj); Py_XDECREF(_obj); _obj = item._obj; + SWIG_PYTHON_THREAD_END_BLOCK; return *this; } ~SwigPtr_PyObject() { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; Py_XDECREF(_obj); + SWIG_PYTHON_THREAD_END_BLOCK; } operator PyObject *() const @@ -3144,9 +3229,17 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { #if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromStringAndSize(carray, static_cast< int >(size)); +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); #else - return PyString_FromStringAndSize(carray, static_cast< int >(size)); +#if PY_VERSION_HEX >= 0x03010000 + return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); +#else + return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); +#endif +#endif +#else + return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); #endif } } else { @@ -3162,6 +3255,20 @@ SWIG_FromCharPtr(const char *cptr) } +SWIGINTERNINLINE PyObject* + SWIG_From_unsigned_SS_int (unsigned int value) +{ + return PyInt_FromSize_t((size_t) value); +} + + +SWIGINTERNINLINE PyObject* + SWIG_From_int (int value) +{ + return PyInt_FromLong((long) value); +} + + #define SWIG_From_long PyInt_FromLong @@ -3169,32 +3276,59 @@ SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long (unsigned long value) { return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); + PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); } SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_int (unsigned int value) +SWIG_From_unsigned_SS_short (unsigned short value) { return SWIG_From_unsigned_SS_long (value); } -SWIGINTERNINLINE PyObject * -SWIG_From_int (int value) -{ - return SWIG_From_long (value); -} +#include -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_short (unsigned short value) -{ - return SWIG_From_unsigned_SS_long (value); -} +#include -#include +/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ +#ifndef SWIG_isfinite +/* isfinite() is a macro for C99 */ +# if defined(isfinite) +# define SWIG_isfinite(X) (isfinite(X)) +# elif defined __cplusplus && __cplusplus >= 201103L +/* Use a template so that this works whether isfinite() is std::isfinite() or + * in the global namespace. The reality seems to vary between compiler + * versions. + * + * Make sure namespace std exists to avoid compiler warnings. + * + * extern "C++" is required as this fragment can end up inside an extern "C" { } block + */ +namespace std { } +extern "C++" template +inline int SWIG_isfinite_func(T x) { + using namespace std; + return isfinite(x); +} +# define SWIG_isfinite(X) (SWIG_isfinite_func(X)) +# elif defined(_MSC_VER) +# define SWIG_isfinite(X) (_finite(X)) +# elif defined(__sun) && defined(__SVR4) +# include +# define SWIG_isfinite(X) (finite(X)) +# endif +#endif + + +/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ +#ifdef SWIG_isfinite +# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) +#else +# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) +#endif SWIGINTERN int @@ -3204,9 +3338,11 @@ SWIG_AsVal_double (PyObject *obj, double *val) if (PyFloat_Check(obj)) { if (val) *val = PyFloat_AsDouble(obj); return SWIG_OK; +#if PY_VERSION_HEX < 0x03000000 } else if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); + if (val) *val = (double) PyInt_AsLong(obj); return SWIG_OK; +#endif } else if (PyLong_Check(obj)) { double v = PyLong_AsDouble(obj); if (!PyErr_Occurred()) { @@ -3247,7 +3383,7 @@ SWIG_AsVal_float (PyObject * obj, float *val) double v; int res = SWIG_AsVal_double (obj, &v); if (SWIG_IsOK(res)) { - if ((v < -FLT_MAX || v > FLT_MAX)) { + if (SWIG_Float_Overflow_Check(v)) { return SWIG_OverflowError; } else { if (val) *val = static_cast< float >(v); @@ -3288,9 +3424,6 @@ SWIGINTERNINLINE PyObject* } -#include - - SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max) { double x = *d; @@ -3324,6 +3457,7 @@ SWIG_CanCastAsInteger(double *d, double min, double max) { SWIGINTERN int SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) { +#if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(obj)) { long v = PyInt_AsLong(obj); if (v >= 0) { @@ -3332,13 +3466,16 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) } else { return SWIG_OverflowError; } - } else if (PyLong_Check(obj)) { + } else +#endif + if (PyLong_Check(obj)) { unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); + return SWIG_OverflowError; } } #ifdef SWIG_PYTHON_CAST_MODE @@ -3365,46 +3502,126 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) } +#include +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) +# define SWIG_LONG_LONG_AVAILABLE +#endif + + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) +{ + int res = SWIG_TypeError; + if (PyLong_Check(obj)) { + unsigned long long v = PyLong_AsUnsignedLongLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + res = SWIG_OverflowError; + } + } else { + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long (obj,&v); + if (SWIG_IsOK(res)) { + if (val) *val = v; + return res; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + const double mant_max = 1LL << DBL_MANT_DIG; + double d; + res = SWIG_AsVal_double (obj,&d); + if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) + return SWIG_OverflowError; + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { + if (val) *val = (unsigned long long)(d); + return SWIG_AddCast(res); + } + res = SWIG_TypeError; + } +#endif + return res; +} +#endif + + SWIGINTERNINLINE int SWIG_AsVal_size_t (PyObject * obj, size_t *val) { - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); + int res = SWIG_TypeError; +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); +#ifdef SWIG_LONG_LONG_AVAILABLE + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + unsigned long long v; + res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); + } +#endif return res; } -SWIGINTERNINLINE PyObject * -SWIG_From_size_t (size_t value) -{ - return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERNINLINE PyObject* +SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) +{ + return (value > LONG_MAX) ? + PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast< long >(value)); } +#endif -#include -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif +SWIGINTERNINLINE PyObject * +SWIG_From_size_t (size_t value) +{ +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { #endif + return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); +#ifdef SWIG_LONG_LONG_AVAILABLE + } else { + /* assume sizeof(size_t) <= sizeof(unsigned long long) */ + return SWIG_From_unsigned_SS_long_SS_long (static_cast< unsigned long long >(value)); + } +#endif +} SWIGINTERN int SWIG_AsVal_long (PyObject *obj, long* val) { +#if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(obj)) { if (val) *val = PyInt_AsLong(obj); return SWIG_OK; - } else if (PyLong_Check(obj)) { + } else +#endif + if (PyLong_Check(obj)) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); + return SWIG_OverflowError; } } #ifdef SWIG_PYTHON_CAST_MODE @@ -3451,13 +3668,18 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { #if PY_VERSION_HEX>=0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + if (PyBytes_Check(obj)) +#else if (PyUnicode_Check(obj)) +#endif #else if (PyString_Check(obj)) #endif { char *cstr; Py_ssize_t len; #if PY_VERSION_HEX>=0x03000000 +#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) if (!alloc && cptr) { /* We can't allow converting without allocation, since the internal representation of string in Python 3 is UCS-2/UCS-4 but we require @@ -3466,8 +3688,9 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) return SWIG_RuntimeError; } obj = PyUnicode_AsUTF8String(obj); - PyBytes_AsStringAndSize(obj, &cstr, &len); if(alloc) *alloc = SWIG_NEWOBJ; +#endif + PyBytes_AsStringAndSize(obj, &cstr, &len); #else PyString_AsStringAndSize(obj, &cstr, &len); #endif @@ -3487,27 +3710,58 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) #else if (*alloc == SWIG_NEWOBJ) #endif - { - *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } - else { + { + *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); + *alloc = SWIG_NEWOBJ; + } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; } } else { - #if PY_VERSION_HEX>=0x03000000 - assert(0); /* Should never reach here in Python 3 */ - #endif +#if PY_VERSION_HEX>=0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + *cptr = PyBytes_AsString(obj); +#else + assert(0); /* Should never reach here with Unicode strings in Python 3 */ +#endif +#else *cptr = SWIG_Python_str_AsChar(obj); +#endif } } if (psize) *psize = len + 1; -#if PY_VERSION_HEX>=0x03000000 +#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) Py_XDECREF(obj); #endif return SWIG_OK; } else { +#if defined(SWIG_PYTHON_2_UNICODE) +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) +#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" +#endif +#if PY_VERSION_HEX<0x03000000 + if (PyUnicode_Check(obj)) { + char *cstr; Py_ssize_t len; + if (!alloc && cptr) { + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { + if (cptr) { + if (alloc) *alloc = SWIG_NEWOBJ; + *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1))); + } + if (psize) *psize = len + 1; + + Py_XDECREF(obj); + return SWIG_OK; + } else { + Py_XDECREF(obj); + } + } +#endif +#endif + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); if (pchar_descriptor) { void* vptr = 0; @@ -3549,7 +3803,10 @@ SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) SWIGINTERN int SWIG_AsVal_bool (PyObject *obj, bool *val) { - int r = PyObject_IsTrue(obj); + int r; + if (!PyBool_Check(obj)) + return SWIG_ERROR; + r = PyObject_IsTrue(obj); if (r == -1) return SWIG_ERROR; if (val) *val = r ? true : false; @@ -3567,11 +3824,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_filename_get(PyObject *SWIGUNUSEDPARM( mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_filename_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_filename_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3589,11 +3847,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_charset_get(PyObject *SWIGUNUSEDPARM(s mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_charset_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_charset_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3611,11 +3870,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_size_get(PyObject *SWIGUNUSEDPARM(self mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_size_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3633,11 +3893,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_type_get(PyObject *SWIGUNUSEDPARM(self mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_type_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3655,11 +3916,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_lsize_get(PyObject *SWIGUNUSEDPARM(sel mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_lsize_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_lsize_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3677,11 +3939,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_rsize_get(PyObject *SWIGUNUSEDPARM(sel mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_rsize_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_rsize_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3699,11 +3962,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_version_get(PyObject *SWIGUNUSEDPARM(s mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_version_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_version_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3721,11 +3985,12 @@ SWIGINTERN PyObject *_wrap_DictionaryInfo_next_get(PyObject *SWIGUNUSEDPARM(self mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_dictionary_info_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:DictionaryInfo_next_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_next_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3742,7 +4007,7 @@ SWIGINTERN PyObject *_wrap_new_DictionaryInfo(PyObject *SWIGUNUSEDPARM(self), Py PyObject *resultobj = 0; mecab_dictionary_info_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_DictionaryInfo")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args,"new_DictionaryInfo",0,0,0)) SWIG_fail; { try { result = (mecab_dictionary_info_t *)new mecab_dictionary_info_t(); @@ -3766,10 +4031,11 @@ SWIGINTERN PyObject *_wrap_delete_DictionaryInfo(PyObject *SWIGUNUSEDPARM(self), mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_DictionaryInfo",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_dictionary_info_t, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_dictionary_info_t, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DictionaryInfo" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'"); } @@ -3794,21 +4060,26 @@ SWIGINTERN PyObject *_wrap_delete_DictionaryInfo(PyObject *SWIGUNUSEDPARM(self), SWIGINTERN PyObject *DictionaryInfo_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args,(char *)"swigregister", 1, 1,&obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_mecab_dictionary_info_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *DictionaryInfo_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_Path_rnode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; mecab_path_t *arg1 = (mecab_path_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_node_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Path_rnode_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_rnode_get" "', argument " "1"" of type '" "mecab_path_t *""'"); } @@ -3826,11 +4097,12 @@ SWIGINTERN PyObject *_wrap_Path_rnext_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_path_t *arg1 = (mecab_path_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_path_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Path_rnext_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_rnext_get" "', argument " "1"" of type '" "mecab_path_t *""'"); } @@ -3848,11 +4120,12 @@ SWIGINTERN PyObject *_wrap_Path_lnode_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_path_t *arg1 = (mecab_path_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_node_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Path_lnode_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_lnode_get" "', argument " "1"" of type '" "mecab_path_t *""'"); } @@ -3870,11 +4143,12 @@ SWIGINTERN PyObject *_wrap_Path_lnext_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_path_t *arg1 = (mecab_path_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_path_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Path_lnext_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_lnext_get" "', argument " "1"" of type '" "mecab_path_t *""'"); } @@ -3892,11 +4166,12 @@ SWIGINTERN PyObject *_wrap_Path_cost_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_path_t *arg1 = (mecab_path_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:Path_cost_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_cost_get" "', argument " "1"" of type '" "mecab_path_t *""'"); } @@ -3917,16 +4192,15 @@ SWIGINTERN PyObject *_wrap_Path_prob_set(PyObject *SWIGUNUSEDPARM(self), PyObjec int res1 = 0 ; float val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Path_prob_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Path_prob_set",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_prob_set" "', argument " "1"" of type '" "mecab_path_t *""'"); } arg1 = reinterpret_cast< mecab_path_t * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Path_prob_set" "', argument " "2"" of type '" "float""'"); } @@ -3944,11 +4218,12 @@ SWIGINTERN PyObject *_wrap_Path_prob_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_path_t *arg1 = (mecab_path_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:Path_prob_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_prob_get" "', argument " "1"" of type '" "mecab_path_t *""'"); } @@ -3963,7 +4238,7 @@ SWIGINTERN PyObject *_wrap_Path_prob_get(PyObject *SWIGUNUSEDPARM(self), PyObjec SWIGINTERN PyObject *Path_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args,(char *)"swigregister", 1, 1,&obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_mecab_path_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -3973,11 +4248,12 @@ SWIGINTERN PyObject *_wrap_Node_prev_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_node_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_prev_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_prev_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -3995,11 +4271,12 @@ SWIGINTERN PyObject *_wrap_Node_next_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_node_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_next_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_next_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4017,11 +4294,12 @@ SWIGINTERN PyObject *_wrap_Node_enext_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_node_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_enext_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_enext_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4039,11 +4317,12 @@ SWIGINTERN PyObject *_wrap_Node_bnext_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_node_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_bnext_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_bnext_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4061,11 +4340,12 @@ SWIGINTERN PyObject *_wrap_Node_rpath_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_path_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_rpath_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_rpath_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4083,11 +4363,12 @@ SWIGINTERN PyObject *_wrap_Node_lpath_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; mecab_path_t *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_lpath_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_lpath_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4105,11 +4386,12 @@ SWIGINTERN PyObject *_wrap_Node_feature_get(PyObject *SWIGUNUSEDPARM(self), PyOb mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_feature_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_feature_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4127,11 +4409,12 @@ SWIGINTERN PyObject *_wrap_Node_id_get(PyObject *SWIGUNUSEDPARM(self), PyObject mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned int result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_id_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_id_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4149,11 +4432,12 @@ SWIGINTERN PyObject *_wrap_Node_length_get(PyObject *SWIGUNUSEDPARM(self), PyObj mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_length_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_length_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4171,11 +4455,12 @@ SWIGINTERN PyObject *_wrap_Node_rlength_get(PyObject *SWIGUNUSEDPARM(self), PyOb mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_rlength_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_rlength_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4193,11 +4478,12 @@ SWIGINTERN PyObject *_wrap_Node_rcAttr_get(PyObject *SWIGUNUSEDPARM(self), PyObj mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_rcAttr_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_rcAttr_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4215,11 +4501,12 @@ SWIGINTERN PyObject *_wrap_Node_lcAttr_get(PyObject *SWIGUNUSEDPARM(self), PyObj mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_lcAttr_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_lcAttr_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4237,11 +4524,12 @@ SWIGINTERN PyObject *_wrap_Node_posid_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned short result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_posid_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_posid_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4259,11 +4547,12 @@ SWIGINTERN PyObject *_wrap_Node_char_type_get(PyObject *SWIGUNUSEDPARM(self), Py mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned char result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_char_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_char_type_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4281,11 +4570,12 @@ SWIGINTERN PyObject *_wrap_Node_stat_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned char result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_stat_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_stat_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4303,11 +4593,12 @@ SWIGINTERN PyObject *_wrap_Node_isbest_get(PyObject *SWIGUNUSEDPARM(self), PyObj mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; unsigned char result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_isbest_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_isbest_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4325,11 +4616,12 @@ SWIGINTERN PyObject *_wrap_Node_alpha_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_alpha_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_alpha_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4347,11 +4639,12 @@ SWIGINTERN PyObject *_wrap_Node_beta_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_beta_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_beta_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4372,16 +4665,15 @@ SWIGINTERN PyObject *_wrap_Node_prob_set(PyObject *SWIGUNUSEDPARM(self), PyObjec int res1 = 0 ; float val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Node_prob_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Node_prob_set",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_prob_set" "', argument " "1"" of type '" "mecab_node_t *""'"); } arg1 = reinterpret_cast< mecab_node_t * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Node_prob_set" "', argument " "2"" of type '" "float""'"); } @@ -4399,11 +4691,12 @@ SWIGINTERN PyObject *_wrap_Node_prob_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_prob_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_prob_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4421,11 +4714,12 @@ SWIGINTERN PyObject *_wrap_Node_wcost_get(PyObject *SWIGUNUSEDPARM(self), PyObje mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; short result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_wcost_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_wcost_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4443,11 +4737,12 @@ SWIGINTERN PyObject *_wrap_Node_cost_get(PyObject *SWIGUNUSEDPARM(self), PyObjec mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; long result; - if (!PyArg_ParseTuple(args,(char *)"O:Node_cost_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_cost_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4465,11 +4760,12 @@ SWIGINTERN PyObject *_wrap_Node_surface_get(PyObject *SWIGUNUSEDPARM(self), PyOb mecab_node_t *arg1 = (mecab_node_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Node_surface_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_surface_get" "', argument " "1"" of type '" "mecab_node_t *""'"); } @@ -4495,7 +4791,7 @@ SWIGINTERN PyObject *_wrap_Node_surface_get(PyObject *SWIGUNUSEDPARM(self), PyOb SWIGINTERN PyObject *Node_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args,(char *)"swigregister", 1, 1,&obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_mecab_node_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -4505,10 +4801,11 @@ SWIGINTERN PyObject *_wrap_Lattice_clear(PyObject *SWIGUNUSEDPARM(self), PyObjec MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_clear" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } @@ -4536,11 +4833,12 @@ SWIGINTERN PyObject *_wrap_Lattice_is_available(PyObject *SWIGUNUSEDPARM(self), MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_is_available",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_is_available" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4568,11 +4866,12 @@ SWIGINTERN PyObject *_wrap_Lattice_bos_node(PyObject *SWIGUNUSEDPARM(self), PyOb MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_bos_node",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_bos_node" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4600,11 +4899,12 @@ SWIGINTERN PyObject *_wrap_Lattice_eos_node(PyObject *SWIGUNUSEDPARM(self), PyOb MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_eos_node",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_eos_node" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4635,17 +4935,16 @@ SWIGINTERN PyObject *_wrap_Lattice_end_nodes(PyObject *SWIGUNUSEDPARM(self), PyO int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_end_nodes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_end_nodes",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_end_nodes" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_end_nodes" "', argument " "2"" of type '" "size_t""'"); } @@ -4676,17 +4975,16 @@ SWIGINTERN PyObject *_wrap_Lattice_begin_nodes(PyObject *SWIGUNUSEDPARM(self), P int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_begin_nodes",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_begin_nodes",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_begin_nodes" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_begin_nodes" "', argument " "2"" of type '" "size_t""'"); } @@ -4714,11 +5012,12 @@ SWIGINTERN PyObject *_wrap_Lattice_sentence(PyObject *SWIGUNUSEDPARM(self), PyOb MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_sentence",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_sentence" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4746,11 +5045,12 @@ SWIGINTERN PyObject *_wrap_Lattice_size(PyObject *SWIGUNUSEDPARM(self), PyObject MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; size_t result; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_size",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_size" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4781,16 +5081,15 @@ SWIGINTERN PyObject *_wrap_Lattice_set_Z(PyObject *SWIGUNUSEDPARM(self), PyObjec int res1 = 0 ; double val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_set_Z",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_Z",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_Z" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_double(obj1, &val2); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_Z" "', argument " "2"" of type '" "double""'"); } @@ -4818,11 +5117,12 @@ SWIGINTERN PyObject *_wrap_Lattice_Z(PyObject *SWIGUNUSEDPARM(self), PyObject *a MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; double result; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_Z",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_Z" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4853,16 +5153,15 @@ SWIGINTERN PyObject *_wrap_Lattice_set_theta(PyObject *SWIGUNUSEDPARM(self), PyO int res1 = 0 ; float val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_set_theta",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_theta",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_theta" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_theta" "', argument " "2"" of type '" "float""'"); } @@ -4890,11 +5189,12 @@ SWIGINTERN PyObject *_wrap_Lattice_theta(PyObject *SWIGUNUSEDPARM(self), PyObjec MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_theta",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_theta" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4922,11 +5222,12 @@ SWIGINTERN PyObject *_wrap_Lattice_next(PyObject *SWIGUNUSEDPARM(self), PyObject MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_next",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_next" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } @@ -4954,11 +5255,12 @@ SWIGINTERN PyObject *_wrap_Lattice_request_type(PyObject *SWIGUNUSEDPARM(self), MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_request_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_request_type" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -4989,17 +5291,16 @@ SWIGINTERN PyObject *_wrap_Lattice_has_request_type(PyObject *SWIGUNUSEDPARM(sel int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_has_request_type",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_has_request_type",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_has_request_type" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_has_request_type" "', argument " "2"" of type '" "int""'"); } @@ -5030,16 +5331,15 @@ SWIGINTERN PyObject *_wrap_Lattice_set_request_type(PyObject *SWIGUNUSEDPARM(sel int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_set_request_type",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_request_type",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_request_type" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_request_type" "', argument " "2"" of type '" "int""'"); } @@ -5070,16 +5370,15 @@ SWIGINTERN PyObject *_wrap_Lattice_add_request_type(PyObject *SWIGUNUSEDPARM(sel int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_add_request_type",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_add_request_type",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_add_request_type" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_add_request_type" "', argument " "2"" of type '" "int""'"); } @@ -5110,16 +5409,15 @@ SWIGINTERN PyObject *_wrap_Lattice_remove_request_type(PyObject *SWIGUNUSEDPARM( int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_remove_request_type",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_remove_request_type",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_remove_request_type" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_remove_request_type" "', argument " "2"" of type '" "int""'"); } @@ -5147,11 +5445,12 @@ SWIGINTERN PyObject *_wrap_Lattice_newNode(PyObject *SWIGUNUSEDPARM(self), PyObj MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_newNode",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_newNode" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } @@ -5174,16 +5473,15 @@ SWIGINTERN PyObject *_wrap_Lattice_newNode(PyObject *SWIGUNUSEDPARM(self), PyObj } -SWIGINTERN PyObject *_wrap_Lattice_toString__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Lattice_toString__SWIG_0(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_toString",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_toString" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } @@ -5206,7 +5504,7 @@ SWIGINTERN PyObject *_wrap_Lattice_toString__SWIG_0(PyObject *SWIGUNUSEDPARM(sel } -SWIGINTERN PyObject *_wrap_Lattice_toString__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Lattice_toString__SWIG_1(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *arg2 = (MeCab::Node *) 0 ; @@ -5214,17 +5512,15 @@ SWIGINTERN PyObject *_wrap_Lattice_toString__SWIG_1(PyObject *SWIGUNUSEDPARM(sel int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_toString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_toString" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_toString" "', argument " "2"" of type '" "MeCab::Node const *""'"); } @@ -5248,37 +5544,18 @@ SWIGINTERN PyObject *_wrap_Lattice_toString__SWIG_1(PyObject *SWIGUNUSEDPARM(sel SWIGINTERN PyObject *_wrap_Lattice_toString(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? (int)PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } + if (!(argc = SWIG_Python_UnpackTuple(args,"Lattice_toString",0,2,argv))) SWIG_fail; + --argc; if (argc == 1) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Lattice, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Lattice_toString__SWIG_0(self, args); - } + return _wrap_Lattice_toString__SWIG_0(self, argc, argv); } if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Lattice, 0); - _v = SWIG_CheckState(res); - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_mecab_node_t, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Lattice_toString__SWIG_1(self, args); - } - } + return _wrap_Lattice_toString__SWIG_1(self, argc, argv); } fail: @@ -5298,17 +5575,16 @@ SWIGINTERN PyObject *_wrap_Lattice_enumNBestAsString(PyObject *SWIGUNUSEDPARM(se int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_enumNBestAsString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_enumNBestAsString",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_enumNBestAsString" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_enumNBestAsString" "', argument " "2"" of type '" "size_t""'"); } @@ -5336,11 +5612,12 @@ SWIGINTERN PyObject *_wrap_Lattice_has_constraint(PyObject *SWIGUNUSEDPARM(self) MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_has_constraint",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_has_constraint" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -5371,17 +5648,16 @@ SWIGINTERN PyObject *_wrap_Lattice_boundary_constraint(PyObject *SWIGUNUSEDPARM( int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_boundary_constraint",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_boundary_constraint",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_boundary_constraint" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_boundary_constraint" "', argument " "2"" of type '" "size_t""'"); } @@ -5412,17 +5688,16 @@ SWIGINTERN PyObject *_wrap_Lattice_feature_constraint(PyObject *SWIGUNUSEDPARM(s int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_feature_constraint",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_feature_constraint",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_feature_constraint" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_feature_constraint" "', argument " "2"" of type '" "size_t""'"); } @@ -5456,22 +5731,20 @@ SWIGINTERN PyObject *_wrap_Lattice_set_boundary_constraint(PyObject *SWIGUNUSEDP int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; - if (!PyArg_ParseTuple(args,(char *)"OOO:Lattice_set_boundary_constraint",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_boundary_constraint",3,3,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_boundary_constraint" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_boundary_constraint" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Lattice_set_boundary_constraint" "', argument " "3"" of type '" "int""'"); } @@ -5509,28 +5782,25 @@ SWIGINTERN PyObject *_wrap_Lattice_set_feature_constraint(PyObject *SWIGUNUSEDPA int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; - if (!PyArg_ParseTuple(args,(char *)"OOOO:Lattice_set_feature_constraint",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_feature_constraint",4,4,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_feature_constraint" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_feature_constraint" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Lattice_set_feature_constraint" "', argument " "3"" of type '" "size_t""'"); } arg3 = static_cast< size_t >(val3); - res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Lattice_set_feature_constraint" "', argument " "4"" of type '" "char const *""'"); } @@ -5564,16 +5834,15 @@ SWIGINTERN PyObject *_wrap_Lattice_set_result(PyObject *SWIGUNUSEDPARM(self), Py int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_set_result",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_result",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_result" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_set_result" "', argument " "2"" of type '" "char const *""'"); } @@ -5603,11 +5872,12 @@ SWIGINTERN PyObject *_wrap_Lattice_what(PyObject *SWIGUNUSEDPARM(self), PyObject MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Lattice_what",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_what" "', argument " "1"" of type '" "MeCab::Lattice const *""'"); } @@ -5639,16 +5909,15 @@ SWIGINTERN PyObject *_wrap_Lattice_set_what(PyObject *SWIGUNUSEDPARM(self), PyOb int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_set_what",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_what",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_what" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_set_what" "', argument " "2"" of type '" "char const *""'"); } @@ -5678,10 +5947,11 @@ SWIGINTERN PyObject *_wrap_delete_Lattice(PyObject *SWIGUNUSEDPARM(self), PyObje MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_Lattice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Lattice" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } @@ -5708,7 +5978,7 @@ SWIGINTERN PyObject *_wrap_new_Lattice(PyObject *SWIGUNUSEDPARM(self), PyObject PyObject *resultobj = 0; MeCab::Lattice *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_Lattice")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args,"new_Lattice",0,0,0)) SWIG_fail; { try { result = (MeCab::Lattice *)new_MeCab_Lattice(); @@ -5736,16 +6006,15 @@ SWIGINTERN PyObject *_wrap_Lattice_set_sentence(PyObject *SWIGUNUSEDPARM(self), int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Lattice_set_sentence",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Lattice_set_sentence",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_sentence" "', argument " "1"" of type '" "MeCab::Lattice *""'"); } arg1 = reinterpret_cast< MeCab::Lattice * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_set_sentence" "', argument " "2"" of type '" "char const *""'"); } @@ -5772,21 +6041,26 @@ SWIGINTERN PyObject *_wrap_Lattice_set_sentence(PyObject *SWIGUNUSEDPARM(self), SWIGINTERN PyObject *Lattice_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args,(char *)"swigregister", 1, 1,&obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_MeCab__Lattice, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *Lattice_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_Model_dictionary_info(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; MeCab::Model *arg1 = (MeCab::Model *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::DictionaryInfo *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Model_dictionary_info",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_dictionary_info" "', argument " "1"" of type '" "MeCab::Model const *""'"); } @@ -5820,23 +6094,21 @@ SWIGINTERN PyObject *_wrap_Model_transition_cost(PyObject *SWIGUNUSEDPARM(self), int ecode2 = 0 ; unsigned short val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; int result; - if (!PyArg_ParseTuple(args,(char *)"OOO:Model_transition_cost",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Model_transition_cost",3,3,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_transition_cost" "', argument " "1"" of type '" "MeCab::Model const *""'"); } arg1 = reinterpret_cast< MeCab::Model * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); + ecode2 = SWIG_AsVal_unsigned_SS_short(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Model_transition_cost" "', argument " "2"" of type '" "unsigned short""'"); } arg2 = static_cast< unsigned short >(val2); - ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); + ecode3 = SWIG_AsVal_unsigned_SS_short(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Model_transition_cost" "', argument " "3"" of type '" "unsigned short""'"); } @@ -5875,29 +6147,26 @@ SWIGINTERN PyObject *_wrap_Model_lookup(PyObject *SWIGUNUSEDPARM(self), PyObject int alloc3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[4] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOOO:Model_lookup",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Model_lookup",4,4,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_lookup" "', argument " "1"" of type '" "MeCab::Model const *""'"); } arg1 = reinterpret_cast< MeCab::Model * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_lookup" "', argument " "2"" of type '" "char const *""'"); } arg2 = reinterpret_cast< char * >(buf2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Model_lookup" "', argument " "3"" of type '" "char const *""'"); } arg3 = reinterpret_cast< char * >(buf3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Model_lookup" "', argument " "4"" of type '" "MeCab::Lattice *""'"); } @@ -5929,11 +6198,12 @@ SWIGINTERN PyObject *_wrap_Model_createTagger(PyObject *SWIGUNUSEDPARM(self), Py MeCab::Model *arg1 = (MeCab::Model *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::Tagger *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Model_createTagger",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_createTagger" "', argument " "1"" of type '" "MeCab::Model const *""'"); } @@ -5961,11 +6231,12 @@ SWIGINTERN PyObject *_wrap_Model_createLattice(PyObject *SWIGUNUSEDPARM(self), P MeCab::Model *arg1 = (MeCab::Model *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::Lattice *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Model_createLattice",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_createLattice" "', argument " "1"" of type '" "MeCab::Model const *""'"); } @@ -5996,17 +6267,16 @@ SWIGINTERN PyObject *_wrap_Model_swap(PyObject *SWIGUNUSEDPARM(self), PyObject * int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:Model_swap",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Model_swap",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_swap" "', argument " "1"" of type '" "MeCab::Model *""'"); } arg1 = reinterpret_cast< MeCab::Model * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_MeCab__Model, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_swap" "', argument " "2"" of type '" "MeCab::Model *""'"); } @@ -6033,7 +6303,7 @@ SWIGINTERN PyObject *_wrap_Model_version(PyObject *SWIGUNUSEDPARM(self), PyObjec PyObject *resultobj = 0; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":Model_version")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args,"Model_version",0,0,0)) SWIG_fail; { try { result = (char *)MeCab::Model::version(); @@ -6057,10 +6327,11 @@ SWIGINTERN PyObject *_wrap_delete_Model(PyObject *SWIGUNUSEDPARM(self), PyObject MeCab::Model *arg1 = (MeCab::Model *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_Model",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Model, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Model, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Model" "', argument " "1"" of type '" "MeCab::Model *""'"); } @@ -6083,136 +6354,16 @@ SWIGINTERN PyObject *_wrap_delete_Model(PyObject *SWIGUNUSEDPARM(self), PyObject } -SWIGINTERN PyObject *_wrap_Model_create__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char **arg2 = (char **) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - MeCab::Model *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Model_create",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Model_create" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_create" "', argument " "2"" of type '" "char **""'"); - } - arg2 = reinterpret_cast< char ** >(argp2); - { - try { - result = (MeCab::Model *)MeCab::Model::create(arg1,arg2); - } - catch (char *e) { - SWIG_exception (SWIG_RuntimeError, e); - } - catch (const char *e) { - SWIG_exception (SWIG_RuntimeError, (char*)e); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Model_create__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_Model__SWIG_0(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - PyObject * obj0 = 0 ; MeCab::Model *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Model_create",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_create" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - try { - result = (MeCab::Model *)MeCab::Model::create((char const *)arg1); - } - catch (char *e) { - SWIG_exception (SWIG_RuntimeError, e); - } - catch (const char *e) { - SWIG_exception (SWIG_RuntimeError, (char*)e); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Model_create(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? (int)PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Model_create__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Model_create__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Model_create'.\n" - " Possible C/C++ prototypes are:\n" - " MeCab::Model::create(int,char **)\n" - " MeCab::Model::create(char const *)\n"); - return 0; -} - - -SWIGINTERN PyObject *_wrap_new_Model__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - MeCab::Model *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_Model",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Model" "', argument " "1"" of type '" "char const *""'"); } @@ -6237,11 +6388,11 @@ SWIGINTERN PyObject *_wrap_new_Model__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyO } -SWIGINTERN PyObject *_wrap_new_Model__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_Model__SWIG_1(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; MeCab::Model *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_Model")) SWIG_fail; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; { try { result = (MeCab::Model *)new_MeCab_Model(); @@ -6261,25 +6412,18 @@ SWIGINTERN PyObject *_wrap_new_Model__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyO SWIGINTERN PyObject *_wrap_new_Model(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[2]; - int ii; + Py_ssize_t argc; + PyObject *argv[2] = { + 0 + }; - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? (int)PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } + if (!(argc = SWIG_Python_UnpackTuple(args,"new_Model",0,1,argv))) SWIG_fail; + --argc; if (argc == 0) { - return _wrap_new_Model__SWIG_1(self, args); + return _wrap_new_Model__SWIG_1(self, argc, argv); } if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_Model__SWIG_0(self, args); - } + return _wrap_new_Model__SWIG_0(self, argc, argv); } fail: @@ -6293,12 +6437,16 @@ SWIGINTERN PyObject *_wrap_new_Model(PyObject *self, PyObject *args) { SWIGINTERN PyObject *Model_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args,(char *)"swigregister", 1, 1,&obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_MeCab__Model, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } -SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *Model_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + +SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_0(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Model *arg1 = 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; @@ -6306,12 +6454,10 @@ SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_0(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_parse",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_MeCab__Model, 0 | 0); + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_MeCab__Model, 0 | 0); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Model const &""'"); } @@ -6319,7 +6465,7 @@ SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_0(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Model const &""'"); } arg1 = reinterpret_cast< MeCab::Model * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parse" "', argument " "2"" of type '" "MeCab::Lattice *""'"); } @@ -6342,7 +6488,7 @@ SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_0(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_1(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; @@ -6350,17 +6496,15 @@ SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_1(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_parse",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parse" "', argument " "2"" of type '" "MeCab::Lattice *""'"); } @@ -6383,7 +6527,7 @@ SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_1(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_2(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -6392,17 +6536,15 @@ SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_2(PyObject *SWIGUNUSEDPARM(self), int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_parse",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parse" "', argument " "2"" of type '" "char const *""'"); } @@ -6428,54 +6570,44 @@ SWIGINTERN PyObject *_wrap_Tagger_parse__SWIG_2(PyObject *SWIGUNUSEDPARM(self), SWIGINTERN PyObject *_wrap_Tagger_parse(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? (int)PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } + if (!(argc = SWIG_Python_UnpackTuple(args,"Tagger_parse",0,2,argv))) SWIG_fail; + --argc; if (argc == 2) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_MeCab__Model, 0); - _v = SWIG_CheckState(res); - if (_v) { + int _v = 0; + { + int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_MeCab__Model, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_1; + { void *vptr = 0; int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_MeCab__Lattice, 0); _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Tagger_parse__SWIG_0(self, args); - } } + if (!_v) goto check_1; + return _wrap_Tagger_parse__SWIG_0(self, argc, argv); } +check_1: + if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Tagger, 0); - _v = SWIG_CheckState(res); - if (_v) { + int _v = 0; + { void *vptr = 0; int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_MeCab__Lattice, 0); _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Tagger_parse__SWIG_1(self, args); - } } + if (!_v) goto check_2; + return _wrap_Tagger_parse__SWIG_1(self, argc, argv); } +check_2: + if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Tagger, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Tagger_parse__SWIG_2(self, args); - } - } + return _wrap_Tagger_parse__SWIG_2(self, argc, argv); } fail: @@ -6497,17 +6629,16 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToNode(PyObject *SWIGUNUSEDPARM(self), Py int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_parseToNode",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_parseToNode",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseToNode" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseToNode" "', argument " "2"" of type '" "char const *""'"); } @@ -6544,23 +6675,21 @@ SWIGINTERN PyObject *_wrap_Tagger_parseNBest(PyObject *SWIGUNUSEDPARM(self), PyO int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[3] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:Tagger_parseNBest",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_parseNBest",3,3,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseNBest" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - ecode2 = SWIG_AsVal_size_t(obj1, &val2); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_parseNBest" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Tagger_parseNBest" "', argument " "3"" of type '" "char const *""'"); } @@ -6594,17 +6723,16 @@ SWIGINTERN PyObject *_wrap_Tagger_parseNBestInit(PyObject *SWIGUNUSEDPARM(self), int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_parseNBestInit",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_parseNBestInit",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseNBestInit" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseNBestInit" "', argument " "2"" of type '" "char const *""'"); } @@ -6634,11 +6762,12 @@ SWIGINTERN PyObject *_wrap_Tagger_nextNode(PyObject *SWIGUNUSEDPARM(self), PyObj MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::Node *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_nextNode",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_nextNode" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } @@ -6666,11 +6795,12 @@ SWIGINTERN PyObject *_wrap_Tagger_next(PyObject *SWIGUNUSEDPARM(self), PyObject MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_next",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_next" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } @@ -6701,17 +6831,16 @@ SWIGINTERN PyObject *_wrap_Tagger_formatNode(PyObject *SWIGUNUSEDPARM(self), PyO int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_formatNode",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_formatNode",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_formatNode" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_mecab_node_t, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_mecab_node_t, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_formatNode" "', argument " "2"" of type '" "MeCab::Node const *""'"); } @@ -6742,16 +6871,15 @@ SWIGINTERN PyObject *_wrap_Tagger_set_request_type(PyObject *SWIGUNUSEDPARM(self int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_set_request_type",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_set_request_type",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_request_type" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_request_type" "', argument " "2"" of type '" "int""'"); } @@ -6779,11 +6907,12 @@ SWIGINTERN PyObject *_wrap_Tagger_request_type(PyObject *SWIGUNUSEDPARM(self), P MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_request_type",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_request_type" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } @@ -6811,11 +6940,12 @@ SWIGINTERN PyObject *_wrap_Tagger_partial(PyObject *SWIGUNUSEDPARM(self), PyObje MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_partial",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_partial" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } @@ -6846,16 +6976,15 @@ SWIGINTERN PyObject *_wrap_Tagger_set_partial(PyObject *SWIGUNUSEDPARM(self), Py int res1 = 0 ; bool val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_set_partial",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_set_partial",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_partial" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_partial" "', argument " "2"" of type '" "bool""'"); } @@ -6883,11 +7012,12 @@ SWIGINTERN PyObject *_wrap_Tagger_lattice_level(PyObject *SWIGUNUSEDPARM(self), MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; int result; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_lattice_level",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_lattice_level" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } @@ -6918,16 +7048,15 @@ SWIGINTERN PyObject *_wrap_Tagger_set_lattice_level(PyObject *SWIGUNUSEDPARM(sel int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_set_lattice_level",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_set_lattice_level",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_lattice_level" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_lattice_level" "', argument " "2"" of type '" "int""'"); } @@ -6955,11 +7084,12 @@ SWIGINTERN PyObject *_wrap_Tagger_all_morphs(PyObject *SWIGUNUSEDPARM(self), PyO MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; bool result; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_all_morphs",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_all_morphs" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } @@ -6990,16 +7120,15 @@ SWIGINTERN PyObject *_wrap_Tagger_set_all_morphs(PyObject *SWIGUNUSEDPARM(self), int res1 = 0 ; bool val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_set_all_morphs",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_set_all_morphs",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_all_morphs" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_all_morphs" "', argument " "2"" of type '" "bool""'"); } @@ -7030,16 +7159,15 @@ SWIGINTERN PyObject *_wrap_Tagger_set_theta(PyObject *SWIGUNUSEDPARM(self), PyOb int res1 = 0 ; float val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_set_theta",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args,"Tagger_set_theta",2,2,swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_theta" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); + ecode2 = SWIG_AsVal_float(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_theta" "', argument " "2"" of type '" "float""'"); } @@ -7067,11 +7195,12 @@ SWIGINTERN PyObject *_wrap_Tagger_theta(PyObject *SWIGUNUSEDPARM(self), PyObject MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; float result; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_theta",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_theta" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } @@ -7099,11 +7228,12 @@ SWIGINTERN PyObject *_wrap_Tagger_dictionary_info(PyObject *SWIGUNUSEDPARM(self) MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; MeCab::DictionaryInfo *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_dictionary_info",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_dictionary_info" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } @@ -7131,11 +7261,12 @@ SWIGINTERN PyObject *_wrap_Tagger_what(PyObject *SWIGUNUSEDPARM(self), PyObject MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_what",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_what" "', argument " "1"" of type '" "MeCab::Tagger const *""'"); } @@ -7163,10 +7294,11 @@ SWIGINTERN PyObject *_wrap_delete_Tagger(PyObject *SWIGUNUSEDPARM(self), PyObjec MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_Tagger",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Tagger" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } @@ -7189,130 +7321,11 @@ SWIGINTERN PyObject *_wrap_delete_Tagger(PyObject *SWIGUNUSEDPARM(self), PyObjec } -SWIGINTERN PyObject *_wrap_Tagger_create__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - char **arg2 = (char **) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - MeCab::Tagger *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_create",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Tagger_create" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_create" "', argument " "2"" of type '" "char **""'"); - } - arg2 = reinterpret_cast< char ** >(argp2); - { - try { - result = (MeCab::Tagger *)MeCab::Tagger::create(arg1,arg2); - } - catch (char *e) { - SWIG_exception (SWIG_RuntimeError, e); - } - catch (const char *e) { - SWIG_exception (SWIG_RuntimeError, (char*)e); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Tagger_create__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - MeCab::Tagger *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Tagger_create",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_create" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - { - try { - result = (MeCab::Tagger *)MeCab::Tagger::create((char const *)arg1); - } - catch (char *e) { - SWIG_exception (SWIG_RuntimeError, e); - } - catch (const char *e) { - SWIG_exception (SWIG_RuntimeError, (char*)e); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Tagger_create(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? (int)PyObject_Length(args) : 0; - for (ii = 0; (ii < 2) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Tagger_create__SWIG_1(self, args); - } - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_char, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Tagger_create__SWIG_0(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Tagger_create'.\n" - " Possible C/C++ prototypes are:\n" - " MeCab::Tagger::create(int,char **)\n" - " MeCab::Tagger::create(char const *)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_Tagger_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":Tagger_version")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args,"Tagger_version",0,0,0)) SWIG_fail; { try { result = (char *)MeCab::Tagger::version(); @@ -7331,17 +7344,16 @@ SWIGINTERN PyObject *_wrap_Tagger_version(PyObject *SWIGUNUSEDPARM(self), PyObje } -SWIGINTERN PyObject *_wrap_new_Tagger__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_Tagger__SWIG_0(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - PyObject * obj0 = 0 ; MeCab::Tagger *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:new_Tagger",&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Tagger" "', argument " "1"" of type '" "char const *""'"); } @@ -7366,11 +7378,11 @@ SWIGINTERN PyObject *_wrap_new_Tagger__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py } -SWIGINTERN PyObject *_wrap_new_Tagger__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_new_Tagger__SWIG_1(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { PyObject *resultobj = 0; MeCab::Tagger *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)":new_Tagger")) SWIG_fail; + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; { try { result = (MeCab::Tagger *)new_MeCab_Tagger(); @@ -7390,25 +7402,18 @@ SWIGINTERN PyObject *_wrap_new_Tagger__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py SWIGINTERN PyObject *_wrap_new_Tagger(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[2]; - int ii; + Py_ssize_t argc; + PyObject *argv[2] = { + 0 + }; - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? (int)PyObject_Length(args) : 0; - for (ii = 0; (ii < 1) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } + if (!(argc = SWIG_Python_UnpackTuple(args,"new_Tagger",0,1,argv))) SWIG_fail; + --argc; if (argc == 0) { - return _wrap_new_Tagger__SWIG_1(self, args); + return _wrap_new_Tagger__SWIG_1(self, argc, argv); } if (argc == 1) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_Tagger__SWIG_0(self, args); - } + return _wrap_new_Tagger__SWIG_0(self, argc, argv); } fail: @@ -7420,7 +7425,7 @@ SWIGINTERN PyObject *_wrap_new_Tagger(PyObject *self, PyObject *args) { } -SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_0(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -7432,23 +7437,20 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_0(PyObject *SWIGUNUSEDPARM int alloc2 = 0 ; size_t val3 ; int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OOO:Tagger_parseToString",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseToString" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseToString" "', argument " "2"" of type '" "char const *""'"); } arg2 = reinterpret_cast< char * >(buf2); - ecode3 = SWIG_AsVal_size_t(obj2, &val3); + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Tagger_parseToString" "', argument " "3"" of type '" "size_t""'"); } @@ -7473,7 +7475,7 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_0(PyObject *SWIGUNUSEDPARM } -SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_1(PyObject *SWIGUNUSEDPARM(self), int nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -7482,17 +7484,15 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_1(PyObject *SWIGUNUSEDPARM int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Tagger_parseToString",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseToString" "', argument " "1"" of type '" "MeCab::Tagger *""'"); } arg1 = reinterpret_cast< MeCab::Tagger * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseToString" "', argument " "2"" of type '" "char const *""'"); } @@ -7518,46 +7518,18 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToString__SWIG_1(PyObject *SWIGUNUSEDPARM SWIGINTERN PyObject *_wrap_Tagger_parseToString(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[4]; - int ii; + Py_ssize_t argc; + PyObject *argv[4] = { + 0 + }; - if (!PyTuple_Check(args)) SWIG_fail; - argc = args ? (int)PyObject_Length(args) : 0; - for (ii = 0; (ii < 3) && (ii < argc); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } + if (!(argc = SWIG_Python_UnpackTuple(args,"Tagger_parseToString",0,3,argv))) SWIG_fail; + --argc; if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Tagger, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Tagger_parseToString__SWIG_1(self, args); - } - } + return _wrap_Tagger_parseToString__SWIG_1(self, argc, argv); } if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Tagger, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_size_t(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_Tagger_parseToString__SWIG_0(self, args); - } - } - } + return _wrap_Tagger_parseToString__SWIG_0(self, argc, argv); } fail: @@ -7571,125 +7543,131 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToString(PyObject *self, PyObject *args) SWIGINTERN PyObject *Tagger_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; + if (!SWIG_Python_UnpackTuple(args,(char *)"swigregister", 1, 1,&obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_MeCab__Tagger, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } +SWIGINTERN PyObject *Tagger_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + static PyMethodDef SwigMethods[] = { { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, - { (char *)"DictionaryInfo_filename_get", _wrap_DictionaryInfo_filename_get, METH_VARARGS, NULL}, - { (char *)"DictionaryInfo_charset_get", _wrap_DictionaryInfo_charset_get, METH_VARARGS, NULL}, - { (char *)"DictionaryInfo_size_get", _wrap_DictionaryInfo_size_get, METH_VARARGS, NULL}, - { (char *)"DictionaryInfo_type_get", _wrap_DictionaryInfo_type_get, METH_VARARGS, NULL}, - { (char *)"DictionaryInfo_lsize_get", _wrap_DictionaryInfo_lsize_get, METH_VARARGS, NULL}, - { (char *)"DictionaryInfo_rsize_get", _wrap_DictionaryInfo_rsize_get, METH_VARARGS, NULL}, - { (char *)"DictionaryInfo_version_get", _wrap_DictionaryInfo_version_get, METH_VARARGS, NULL}, - { (char *)"DictionaryInfo_next_get", _wrap_DictionaryInfo_next_get, METH_VARARGS, NULL}, - { (char *)"new_DictionaryInfo", _wrap_new_DictionaryInfo, METH_VARARGS, NULL}, - { (char *)"delete_DictionaryInfo", _wrap_delete_DictionaryInfo, METH_VARARGS, NULL}, + { (char *)"DictionaryInfo_filename_get", (PyCFunction)_wrap_DictionaryInfo_filename_get, METH_O, NULL}, + { (char *)"DictionaryInfo_charset_get", (PyCFunction)_wrap_DictionaryInfo_charset_get, METH_O, NULL}, + { (char *)"DictionaryInfo_size_get", (PyCFunction)_wrap_DictionaryInfo_size_get, METH_O, NULL}, + { (char *)"DictionaryInfo_type_get", (PyCFunction)_wrap_DictionaryInfo_type_get, METH_O, NULL}, + { (char *)"DictionaryInfo_lsize_get", (PyCFunction)_wrap_DictionaryInfo_lsize_get, METH_O, NULL}, + { (char *)"DictionaryInfo_rsize_get", (PyCFunction)_wrap_DictionaryInfo_rsize_get, METH_O, NULL}, + { (char *)"DictionaryInfo_version_get", (PyCFunction)_wrap_DictionaryInfo_version_get, METH_O, NULL}, + { (char *)"DictionaryInfo_next_get", (PyCFunction)_wrap_DictionaryInfo_next_get, METH_O, NULL}, + { (char *)"new_DictionaryInfo", (PyCFunction)_wrap_new_DictionaryInfo, METH_NOARGS, NULL}, + { (char *)"delete_DictionaryInfo", (PyCFunction)_wrap_delete_DictionaryInfo, METH_O, NULL}, { (char *)"DictionaryInfo_swigregister", DictionaryInfo_swigregister, METH_VARARGS, NULL}, - { (char *)"Path_rnode_get", _wrap_Path_rnode_get, METH_VARARGS, NULL}, - { (char *)"Path_rnext_get", _wrap_Path_rnext_get, METH_VARARGS, NULL}, - { (char *)"Path_lnode_get", _wrap_Path_lnode_get, METH_VARARGS, NULL}, - { (char *)"Path_lnext_get", _wrap_Path_lnext_get, METH_VARARGS, NULL}, - { (char *)"Path_cost_get", _wrap_Path_cost_get, METH_VARARGS, NULL}, + { (char *)"DictionaryInfo_swiginit", DictionaryInfo_swiginit, METH_VARARGS, NULL}, + { (char *)"Path_rnode_get", (PyCFunction)_wrap_Path_rnode_get, METH_O, NULL}, + { (char *)"Path_rnext_get", (PyCFunction)_wrap_Path_rnext_get, METH_O, NULL}, + { (char *)"Path_lnode_get", (PyCFunction)_wrap_Path_lnode_get, METH_O, NULL}, + { (char *)"Path_lnext_get", (PyCFunction)_wrap_Path_lnext_get, METH_O, NULL}, + { (char *)"Path_cost_get", (PyCFunction)_wrap_Path_cost_get, METH_O, NULL}, { (char *)"Path_prob_set", _wrap_Path_prob_set, METH_VARARGS, NULL}, - { (char *)"Path_prob_get", _wrap_Path_prob_get, METH_VARARGS, NULL}, + { (char *)"Path_prob_get", (PyCFunction)_wrap_Path_prob_get, METH_O, NULL}, { (char *)"Path_swigregister", Path_swigregister, METH_VARARGS, NULL}, - { (char *)"Node_prev_get", _wrap_Node_prev_get, METH_VARARGS, NULL}, - { (char *)"Node_next_get", _wrap_Node_next_get, METH_VARARGS, NULL}, - { (char *)"Node_enext_get", _wrap_Node_enext_get, METH_VARARGS, NULL}, - { (char *)"Node_bnext_get", _wrap_Node_bnext_get, METH_VARARGS, NULL}, - { (char *)"Node_rpath_get", _wrap_Node_rpath_get, METH_VARARGS, NULL}, - { (char *)"Node_lpath_get", _wrap_Node_lpath_get, METH_VARARGS, NULL}, - { (char *)"Node_feature_get", _wrap_Node_feature_get, METH_VARARGS, NULL}, - { (char *)"Node_id_get", _wrap_Node_id_get, METH_VARARGS, NULL}, - { (char *)"Node_length_get", _wrap_Node_length_get, METH_VARARGS, NULL}, - { (char *)"Node_rlength_get", _wrap_Node_rlength_get, METH_VARARGS, NULL}, - { (char *)"Node_rcAttr_get", _wrap_Node_rcAttr_get, METH_VARARGS, NULL}, - { (char *)"Node_lcAttr_get", _wrap_Node_lcAttr_get, METH_VARARGS, NULL}, - { (char *)"Node_posid_get", _wrap_Node_posid_get, METH_VARARGS, NULL}, - { (char *)"Node_char_type_get", _wrap_Node_char_type_get, METH_VARARGS, NULL}, - { (char *)"Node_stat_get", _wrap_Node_stat_get, METH_VARARGS, NULL}, - { (char *)"Node_isbest_get", _wrap_Node_isbest_get, METH_VARARGS, NULL}, - { (char *)"Node_alpha_get", _wrap_Node_alpha_get, METH_VARARGS, NULL}, - { (char *)"Node_beta_get", _wrap_Node_beta_get, METH_VARARGS, NULL}, + { (char *)"Node_prev_get", (PyCFunction)_wrap_Node_prev_get, METH_O, NULL}, + { (char *)"Node_next_get", (PyCFunction)_wrap_Node_next_get, METH_O, NULL}, + { (char *)"Node_enext_get", (PyCFunction)_wrap_Node_enext_get, METH_O, NULL}, + { (char *)"Node_bnext_get", (PyCFunction)_wrap_Node_bnext_get, METH_O, NULL}, + { (char *)"Node_rpath_get", (PyCFunction)_wrap_Node_rpath_get, METH_O, NULL}, + { (char *)"Node_lpath_get", (PyCFunction)_wrap_Node_lpath_get, METH_O, NULL}, + { (char *)"Node_feature_get", (PyCFunction)_wrap_Node_feature_get, METH_O, NULL}, + { (char *)"Node_id_get", (PyCFunction)_wrap_Node_id_get, METH_O, NULL}, + { (char *)"Node_length_get", (PyCFunction)_wrap_Node_length_get, METH_O, NULL}, + { (char *)"Node_rlength_get", (PyCFunction)_wrap_Node_rlength_get, METH_O, NULL}, + { (char *)"Node_rcAttr_get", (PyCFunction)_wrap_Node_rcAttr_get, METH_O, NULL}, + { (char *)"Node_lcAttr_get", (PyCFunction)_wrap_Node_lcAttr_get, METH_O, NULL}, + { (char *)"Node_posid_get", (PyCFunction)_wrap_Node_posid_get, METH_O, NULL}, + { (char *)"Node_char_type_get", (PyCFunction)_wrap_Node_char_type_get, METH_O, NULL}, + { (char *)"Node_stat_get", (PyCFunction)_wrap_Node_stat_get, METH_O, NULL}, + { (char *)"Node_isbest_get", (PyCFunction)_wrap_Node_isbest_get, METH_O, NULL}, + { (char *)"Node_alpha_get", (PyCFunction)_wrap_Node_alpha_get, METH_O, NULL}, + { (char *)"Node_beta_get", (PyCFunction)_wrap_Node_beta_get, METH_O, NULL}, { (char *)"Node_prob_set", _wrap_Node_prob_set, METH_VARARGS, NULL}, - { (char *)"Node_prob_get", _wrap_Node_prob_get, METH_VARARGS, NULL}, - { (char *)"Node_wcost_get", _wrap_Node_wcost_get, METH_VARARGS, NULL}, - { (char *)"Node_cost_get", _wrap_Node_cost_get, METH_VARARGS, NULL}, - { (char *)"Node_surface_get", _wrap_Node_surface_get, METH_VARARGS, NULL}, + { (char *)"Node_prob_get", (PyCFunction)_wrap_Node_prob_get, METH_O, NULL}, + { (char *)"Node_wcost_get", (PyCFunction)_wrap_Node_wcost_get, METH_O, NULL}, + { (char *)"Node_cost_get", (PyCFunction)_wrap_Node_cost_get, METH_O, NULL}, + { (char *)"Node_surface_get", (PyCFunction)_wrap_Node_surface_get, METH_O, NULL}, { (char *)"Node_swigregister", Node_swigregister, METH_VARARGS, NULL}, - { (char *)"Lattice_clear", _wrap_Lattice_clear, METH_VARARGS, NULL}, - { (char *)"Lattice_is_available", _wrap_Lattice_is_available, METH_VARARGS, NULL}, - { (char *)"Lattice_bos_node", _wrap_Lattice_bos_node, METH_VARARGS, NULL}, - { (char *)"Lattice_eos_node", _wrap_Lattice_eos_node, METH_VARARGS, NULL}, + { (char *)"Lattice_clear", (PyCFunction)_wrap_Lattice_clear, METH_O, NULL}, + { (char *)"Lattice_is_available", (PyCFunction)_wrap_Lattice_is_available, METH_O, NULL}, + { (char *)"Lattice_bos_node", (PyCFunction)_wrap_Lattice_bos_node, METH_O, NULL}, + { (char *)"Lattice_eos_node", (PyCFunction)_wrap_Lattice_eos_node, METH_O, NULL}, { (char *)"Lattice_end_nodes", _wrap_Lattice_end_nodes, METH_VARARGS, NULL}, { (char *)"Lattice_begin_nodes", _wrap_Lattice_begin_nodes, METH_VARARGS, NULL}, - { (char *)"Lattice_sentence", _wrap_Lattice_sentence, METH_VARARGS, NULL}, - { (char *)"Lattice_size", _wrap_Lattice_size, METH_VARARGS, NULL}, + { (char *)"Lattice_sentence", (PyCFunction)_wrap_Lattice_sentence, METH_O, NULL}, + { (char *)"Lattice_size", (PyCFunction)_wrap_Lattice_size, METH_O, NULL}, { (char *)"Lattice_set_Z", _wrap_Lattice_set_Z, METH_VARARGS, NULL}, - { (char *)"Lattice_Z", _wrap_Lattice_Z, METH_VARARGS, NULL}, + { (char *)"Lattice_Z", (PyCFunction)_wrap_Lattice_Z, METH_O, NULL}, { (char *)"Lattice_set_theta", _wrap_Lattice_set_theta, METH_VARARGS, NULL}, - { (char *)"Lattice_theta", _wrap_Lattice_theta, METH_VARARGS, NULL}, - { (char *)"Lattice_next", _wrap_Lattice_next, METH_VARARGS, NULL}, - { (char *)"Lattice_request_type", _wrap_Lattice_request_type, METH_VARARGS, NULL}, + { (char *)"Lattice_theta", (PyCFunction)_wrap_Lattice_theta, METH_O, NULL}, + { (char *)"Lattice_next", (PyCFunction)_wrap_Lattice_next, METH_O, NULL}, + { (char *)"Lattice_request_type", (PyCFunction)_wrap_Lattice_request_type, METH_O, NULL}, { (char *)"Lattice_has_request_type", _wrap_Lattice_has_request_type, METH_VARARGS, NULL}, { (char *)"Lattice_set_request_type", _wrap_Lattice_set_request_type, METH_VARARGS, NULL}, { (char *)"Lattice_add_request_type", _wrap_Lattice_add_request_type, METH_VARARGS, NULL}, { (char *)"Lattice_remove_request_type", _wrap_Lattice_remove_request_type, METH_VARARGS, NULL}, - { (char *)"Lattice_newNode", _wrap_Lattice_newNode, METH_VARARGS, NULL}, + { (char *)"Lattice_newNode", (PyCFunction)_wrap_Lattice_newNode, METH_O, NULL}, { (char *)"Lattice_toString", _wrap_Lattice_toString, METH_VARARGS, NULL}, { (char *)"Lattice_enumNBestAsString", _wrap_Lattice_enumNBestAsString, METH_VARARGS, NULL}, - { (char *)"Lattice_has_constraint", _wrap_Lattice_has_constraint, METH_VARARGS, NULL}, + { (char *)"Lattice_has_constraint", (PyCFunction)_wrap_Lattice_has_constraint, METH_O, NULL}, { (char *)"Lattice_boundary_constraint", _wrap_Lattice_boundary_constraint, METH_VARARGS, NULL}, { (char *)"Lattice_feature_constraint", _wrap_Lattice_feature_constraint, METH_VARARGS, NULL}, { (char *)"Lattice_set_boundary_constraint", _wrap_Lattice_set_boundary_constraint, METH_VARARGS, NULL}, { (char *)"Lattice_set_feature_constraint", _wrap_Lattice_set_feature_constraint, METH_VARARGS, NULL}, { (char *)"Lattice_set_result", _wrap_Lattice_set_result, METH_VARARGS, NULL}, - { (char *)"Lattice_what", _wrap_Lattice_what, METH_VARARGS, NULL}, + { (char *)"Lattice_what", (PyCFunction)_wrap_Lattice_what, METH_O, NULL}, { (char *)"Lattice_set_what", _wrap_Lattice_set_what, METH_VARARGS, NULL}, - { (char *)"delete_Lattice", _wrap_delete_Lattice, METH_VARARGS, NULL}, - { (char *)"new_Lattice", _wrap_new_Lattice, METH_VARARGS, NULL}, + { (char *)"delete_Lattice", (PyCFunction)_wrap_delete_Lattice, METH_O, NULL}, + { (char *)"new_Lattice", (PyCFunction)_wrap_new_Lattice, METH_NOARGS, NULL}, { (char *)"Lattice_set_sentence", _wrap_Lattice_set_sentence, METH_VARARGS, NULL}, { (char *)"Lattice_swigregister", Lattice_swigregister, METH_VARARGS, NULL}, - { (char *)"Model_dictionary_info", _wrap_Model_dictionary_info, METH_VARARGS, NULL}, + { (char *)"Lattice_swiginit", Lattice_swiginit, METH_VARARGS, NULL}, + { (char *)"Model_dictionary_info", (PyCFunction)_wrap_Model_dictionary_info, METH_O, NULL}, { (char *)"Model_transition_cost", _wrap_Model_transition_cost, METH_VARARGS, NULL}, { (char *)"Model_lookup", _wrap_Model_lookup, METH_VARARGS, NULL}, - { (char *)"Model_createTagger", _wrap_Model_createTagger, METH_VARARGS, NULL}, - { (char *)"Model_createLattice", _wrap_Model_createLattice, METH_VARARGS, NULL}, + { (char *)"Model_createTagger", (PyCFunction)_wrap_Model_createTagger, METH_O, NULL}, + { (char *)"Model_createLattice", (PyCFunction)_wrap_Model_createLattice, METH_O, NULL}, { (char *)"Model_swap", _wrap_Model_swap, METH_VARARGS, NULL}, - { (char *)"Model_version", _wrap_Model_version, METH_VARARGS, NULL}, - { (char *)"delete_Model", _wrap_delete_Model, METH_VARARGS, NULL}, - { (char *)"Model_create", _wrap_Model_create, METH_VARARGS, NULL}, + { (char *)"Model_version", (PyCFunction)_wrap_Model_version, METH_NOARGS, NULL}, + { (char *)"delete_Model", (PyCFunction)_wrap_delete_Model, METH_O, NULL}, { (char *)"new_Model", _wrap_new_Model, METH_VARARGS, NULL}, { (char *)"Model_swigregister", Model_swigregister, METH_VARARGS, NULL}, + { (char *)"Model_swiginit", Model_swiginit, METH_VARARGS, NULL}, { (char *)"Tagger_parse", _wrap_Tagger_parse, METH_VARARGS, NULL}, { (char *)"Tagger_parseToNode", _wrap_Tagger_parseToNode, METH_VARARGS, NULL}, { (char *)"Tagger_parseNBest", _wrap_Tagger_parseNBest, METH_VARARGS, NULL}, { (char *)"Tagger_parseNBestInit", _wrap_Tagger_parseNBestInit, METH_VARARGS, NULL}, - { (char *)"Tagger_nextNode", _wrap_Tagger_nextNode, METH_VARARGS, NULL}, - { (char *)"Tagger_next", _wrap_Tagger_next, METH_VARARGS, NULL}, + { (char *)"Tagger_nextNode", (PyCFunction)_wrap_Tagger_nextNode, METH_O, NULL}, + { (char *)"Tagger_next", (PyCFunction)_wrap_Tagger_next, METH_O, NULL}, { (char *)"Tagger_formatNode", _wrap_Tagger_formatNode, METH_VARARGS, NULL}, { (char *)"Tagger_set_request_type", _wrap_Tagger_set_request_type, METH_VARARGS, NULL}, - { (char *)"Tagger_request_type", _wrap_Tagger_request_type, METH_VARARGS, NULL}, - { (char *)"Tagger_partial", _wrap_Tagger_partial, METH_VARARGS, NULL}, + { (char *)"Tagger_request_type", (PyCFunction)_wrap_Tagger_request_type, METH_O, NULL}, + { (char *)"Tagger_partial", (PyCFunction)_wrap_Tagger_partial, METH_O, NULL}, { (char *)"Tagger_set_partial", _wrap_Tagger_set_partial, METH_VARARGS, NULL}, - { (char *)"Tagger_lattice_level", _wrap_Tagger_lattice_level, METH_VARARGS, NULL}, + { (char *)"Tagger_lattice_level", (PyCFunction)_wrap_Tagger_lattice_level, METH_O, NULL}, { (char *)"Tagger_set_lattice_level", _wrap_Tagger_set_lattice_level, METH_VARARGS, NULL}, - { (char *)"Tagger_all_morphs", _wrap_Tagger_all_morphs, METH_VARARGS, NULL}, + { (char *)"Tagger_all_morphs", (PyCFunction)_wrap_Tagger_all_morphs, METH_O, NULL}, { (char *)"Tagger_set_all_morphs", _wrap_Tagger_set_all_morphs, METH_VARARGS, NULL}, { (char *)"Tagger_set_theta", _wrap_Tagger_set_theta, METH_VARARGS, NULL}, - { (char *)"Tagger_theta", _wrap_Tagger_theta, METH_VARARGS, NULL}, - { (char *)"Tagger_dictionary_info", _wrap_Tagger_dictionary_info, METH_VARARGS, NULL}, - { (char *)"Tagger_what", _wrap_Tagger_what, METH_VARARGS, NULL}, - { (char *)"delete_Tagger", _wrap_delete_Tagger, METH_VARARGS, NULL}, - { (char *)"Tagger_create", _wrap_Tagger_create, METH_VARARGS, NULL}, - { (char *)"Tagger_version", _wrap_Tagger_version, METH_VARARGS, NULL}, + { (char *)"Tagger_theta", (PyCFunction)_wrap_Tagger_theta, METH_O, NULL}, + { (char *)"Tagger_dictionary_info", (PyCFunction)_wrap_Tagger_dictionary_info, METH_O, NULL}, + { (char *)"Tagger_what", (PyCFunction)_wrap_Tagger_what, METH_O, NULL}, + { (char *)"delete_Tagger", (PyCFunction)_wrap_delete_Tagger, METH_O, NULL}, + { (char *)"Tagger_version", (PyCFunction)_wrap_Tagger_version, METH_NOARGS, NULL}, { (char *)"new_Tagger", _wrap_new_Tagger, METH_VARARGS, NULL}, { (char *)"Tagger_parseToString", _wrap_Tagger_parseToString, METH_VARARGS, NULL}, { (char *)"Tagger_swigregister", Tagger_swigregister, METH_VARARGS, NULL}, + { (char *)"Tagger_swiginit", Tagger_swiginit, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; @@ -7704,7 +7682,6 @@ static swig_type_info _swigt__p_mecab_dictionary_info_t = {"_p_mecab_dictionary_ static swig_type_info _swigt__p_mecab_node_t = {"_p_mecab_node_t", "mecab_node_t *|MeCab::Node *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_mecab_path_t = {"_p_mecab_path_t", "mecab_path_t *|MeCab::Path *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_mecab_t = {"_p_mecab_t", "mecab_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_MeCab__Lattice, @@ -7715,7 +7692,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_mecab_node_t, &_swigt__p_mecab_path_t, &_swigt__p_mecab_t, - &_swigt__p_p_char, }; static swig_cast_info _swigc__p_MeCab__Lattice[] = { {&_swigt__p_MeCab__Lattice, 0, 0, 0},{0, 0, 0, 0}}; @@ -7726,7 +7702,6 @@ static swig_cast_info _swigc__p_mecab_dictionary_info_t[] = { {&_swigt__p_mecab static swig_cast_info _swigc__p_mecab_node_t[] = { {&_swigt__p_mecab_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_mecab_path_t[] = { {&_swigt__p_mecab_path_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_mecab_t[] = { {&_swigt__p_mecab_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_MeCab__Lattice, @@ -7737,7 +7712,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_mecab_node_t, _swigc__p_mecab_path_t, _swigc__p_mecab_t, - _swigc__p_p_char, }; @@ -7751,18 +7725,18 @@ static swig_const_info swig_const_table[] = { #endif /* ----------------------------------------------------------------------------- * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of * swig_module, and does all the lookup, filling in the swig_module.types * array with the correct data and linking the correct swig_cast_info * structures together. * - * The generated swig_type_info structures are assigned staticly to an initial + * The generated swig_type_info structures are assigned statically to an initial * array. We just loop through that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the @@ -7772,17 +7746,17 @@ static swig_const_info swig_const_table[] = { * a column is one of the swig_cast_info structures for that type. * The cast_initial array is actually an array of arrays, because each row has * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it + * we find the array of casts associated with the type, and loop through it * adding the casts to the list. The one last trick we need to do is making * sure the type pointer in the swig_cast_info struct is correct. * - * First off, we lookup the cast->type name to see if it is already loaded. + * First off, we lookup the cast->type name to see if it is already loaded. * There are three cases to handle: * 1) If the cast->type has already been loaded AND the type we are adding * casting info to has not been loaded (it is in this module), THEN we * replace the cast->type pointer with the type pointer that has already * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the + * 2) If BOTH types (the one we are adding casting info to, and the * cast->type) are loaded, THEN the cast info has already been loaded by * the previous module so we just ignore it. * 3) Finally, if cast->type has not already been loaded, then we add that @@ -7806,9 +7780,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found, init; - - clientdata = clientdata; + int init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { @@ -7827,27 +7799,23 @@ SWIG_InitializeModule(void *clientdata) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); - module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; iter=module_head; do { if (iter==&swig_module) { - found=1; - break; + /* Our module is already in the list, so there's nothing more to do. */ + return; } iter=iter->next; } while (iter!= module_head); - /* if the is found in the list, then all is done and we may leave */ - if (found) return; - /* otherwise we must add out module into the list */ + /* otherwise we must add our module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } - /* When multiple interpeters are used, a module could have already been initialized in + /* When multiple interpreters are used, a module could have already been initialized in a different interpreter, but not yet have a pointer in this interpreter. In this case, we do not want to continue adding types... everything should be set up already */ @@ -8094,7 +8062,7 @@ extern "C" { var = var->next; } if (res == NULL && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); } return res; } @@ -8111,7 +8079,7 @@ extern "C" { var = var->next; } if (res == 1 && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); } return res; } @@ -8123,7 +8091,6 @@ extern "C" { static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { - /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else @@ -8161,10 +8128,19 @@ extern "C" { 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ + 0, /* tp_version_tag */ +#endif +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ +#if PY_VERSION_HEX >= 0x02050000 + 0, /* tp_prev */ +#endif + 0 /* tp_next */ #endif }; varlink_type = tmp; @@ -8253,7 +8229,9 @@ extern "C" { size_t i; for (i = 0; methods[i].ml_name; ++i) { const char *c = methods[i].ml_doc; - if (c && (c = strstr(c, "swig_ptr: "))) { + if (!c) continue; + c = strstr(c, "swig_ptr: "); + if (c) { int j; swig_const_info *ci = 0; const char *name = c + 10; @@ -8344,17 +8322,18 @@ SWIG_init(void) { static PyGetSetDef thisown_getset_def = { (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure }; - PyObject *metatype_args; PyTypeObject *builtin_pytype; int builtin_base_count; swig_type_info *builtin_basetype; PyObject *tuple; PyGetSetDescrObject *static_getset; PyTypeObject *metatype; + PyTypeObject *swigpyobject; SwigPyClientData *cd; PyObject *public_interface, *public_symbol; PyObject *this_descr; PyObject *thisown_descr; + PyObject *self = 0; int i; (void)builtin_pytype; @@ -8362,15 +8341,11 @@ SWIG_init(void) { (void)builtin_basetype; (void)tuple; (void)static_getset; + (void)self; - /* metatype is used to implement static member variables. */ - metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type); - assert(metatype_args); - metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL); + /* Metaclass is used to implement static member variables */ + metatype = SwigPyObjectType(); assert(metatype); - Py_DECREF(metatype_args); - metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro; - assert(PyType_Ready(metatype) >= 0); #endif /* Fix SwigMethods to carry the callback ptrs when needed */ @@ -8381,18 +8356,22 @@ SWIG_init(void) { #else m = Py_InitModule((char *) SWIG_name, SwigMethods); #endif + md = d = PyModule_GetDict(m); + (void)md; SWIG_InitializeModule(0); #ifdef SWIGPYTHON_BUILTIN + swigpyobject = SwigPyObject_TypeOnce(); + SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); assert(SwigPyObject_stype); cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; if (!cd) { SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; - SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce(); - } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) { + SwigPyObject_clientdata.pytype = swigpyobject; + } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) { PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); # if PY_VERSION_HEX >= 0x03000000 return NULL; diff --git a/mecab/python/mecab.h b/mecab/python/mecab.h new file mode 100644 index 0000000..ce7f265 --- /dev/null +++ b/mecab/python/mecab.h @@ -0,0 +1,1509 @@ +/* + MeCab -- Yet Another Part-of-Speech and Morphological Analyzer + + Copyright(C) 2001-2011 Taku Kudo + Copyright(C) 2004-2006 Nippon Telegraph and Telephone Corporation +*/ +#ifndef MECAB_MECAB_H_ +#define MECAB_MECAB_H_ + +/* C/C++ common data structures */ + +/** + * DictionaryInfo structure + */ +struct mecab_dictionary_info_t { + /** + * filename of dictionary + * On Windows, filename is stored in UTF-8 encoding + */ + const char *filename; + + /** + * character set of the dictionary. e.g., "SHIFT-JIS", "UTF-8" + */ + const char *charset; + + /** + * How many words are registered in this dictionary. + */ + unsigned int size; + + /** + * dictionary type + * this value should be MECAB_USR_DIC, MECAB_SYS_DIC, or MECAB_UNK_DIC. + */ + int type; + + /** + * left attributes size + */ + unsigned int lsize; + + /** + * right attributes size + */ + unsigned int rsize; + + /** + * version of this dictionary + */ + unsigned short version; + + /** + * pointer to the next dictionary info. + */ + struct mecab_dictionary_info_t *next; +}; + +/** + * Path structure + */ +struct mecab_path_t { + /** + * pointer to the right node + */ + struct mecab_node_t* rnode; + + /** + * pointer to the next right path + */ + struct mecab_path_t* rnext; + + /** + * pointer to the left node + */ + struct mecab_node_t* lnode; + + /** + * pointer to the next left path + */ + + struct mecab_path_t* lnext; + + /** + * local cost + */ + int cost; + + /** + * marginal probability + */ + float prob; +}; + +/** + * Node structure + */ +struct mecab_node_t { + /** + * pointer to the previous node. + */ + struct mecab_node_t *prev; + + /** + * pointer to the next node. + */ + struct mecab_node_t *next; + + /** + * pointer to the node which ends at the same position. + */ + struct mecab_node_t *enext; + + /** + * pointer to the node which starts at the same position. + */ + struct mecab_node_t *bnext; + + /** + * pointer to the right path. + * this value is NULL if MECAB_ONE_BEST mode. + */ + struct mecab_path_t *rpath; + + /** + * pointer to the right path. + * this value is NULL if MECAB_ONE_BEST mode. + */ + struct mecab_path_t *lpath; + + /** + * surface string. + * this value is not 0 terminated. + * You can get the length with length/rlength members. + */ + const char *surface; + + /** + * feature string + */ + const char *feature; + + /** + * unique node id + */ + unsigned int id; + + /** + * length of the surface form. + */ + unsigned short length; + + /** + * length of the surface form including white space before the morph. + */ + unsigned short rlength; + + /** + * right attribute id + */ + unsigned short rcAttr; + + /** + * left attribute id + */ + unsigned short lcAttr; + + /** + * unique part of speech id. This value is defined in "pos.def" file. + */ + unsigned short posid; + + /** + * character type + */ + unsigned char char_type; + + /** + * status of this model. + * This value is MECAB_NOR_NODE, MECAB_UNK_NODE, MECAB_BOS_NODE, MECAB_EOS_NODE, or MECAB_EON_NODE. + */ + unsigned char stat; + + /** + * set 1 if this node is best node. + */ + unsigned char isbest; + + /** + * forward accumulative log summation. + * This value is only available when MECAB_MARGINAL_PROB is passed. + */ + float alpha; + + /** + * backward accumulative log summation. + * This value is only available when MECAB_MARGINAL_PROB is passed. + */ + float beta; + + /** + * marginal probability. + * This value is only available when MECAB_MARGINAL_PROB is passed. + */ + float prob; + + /** + * word cost. + */ + short wcost; + + /** + * best accumulative cost from bos node to this node. + */ + long cost; +}; + +/** + * Parameters for MeCab::Node::stat + */ +enum { + /** + * Normal node defined in the dictionary. + */ + MECAB_NOR_NODE = 0, + /** + * Unknown node not defined in the dictionary. + */ + MECAB_UNK_NODE = 1, + /** + * Virtual node representing a beginning of the sentence. + */ + MECAB_BOS_NODE = 2, + /** + * Virtual node representing a end of the sentence. + */ + MECAB_EOS_NODE = 3, + + /** + * Virtual node representing a end of the N-best enumeration. + */ + MECAB_EON_NODE = 4 +}; + +/** + * Parameters for MeCab::DictionaryInfo::type + */ +enum { + /** + * This is a system dictionary. + */ + MECAB_SYS_DIC = 0, + + /** + * This is a user dictionary. + */ + MECAB_USR_DIC = 1, + + /** + * This is a unknown word dictionary. + */ + MECAB_UNK_DIC = 2 +}; + +/** + * Parameters for MeCab::Lattice::request_type + */ +enum { + /** + * One best result is obtained (default mode) + */ + MECAB_ONE_BEST = 1, + /** + * Set this flag if you want to obtain N best results. + */ + MECAB_NBEST = 2, + /** + * Set this flag if you want to enable a partial parsing mode. + * When this flag is set, the input |sentence| needs to be written + * in partial parsing format. + */ + MECAB_PARTIAL = 4, + /** + * Set this flag if you want to obtain marginal probabilities. + * Marginal probability is set in MeCab::Node::prob. + * The parsing speed will get 3-5 times slower than the default mode. + */ + MECAB_MARGINAL_PROB = 8, + /** + * Set this flag if you want to obtain alternative results. + * Not implemented. + */ + MECAB_ALTERNATIVE = 16, + /** + * When this flag is set, the result linked-list (Node::next/prev) + * traverses all nodes in the lattice. + */ + MECAB_ALL_MORPHS = 32, + + /** + * When this flag is set, tagger internally copies the body of passed + * sentence into internal buffer. + */ + MECAB_ALLOCATE_SENTENCE = 64 +}; + +/** + * Parameters for MeCab::Lattice::boundary_constraint_type + */ +enum { + /** + * The token boundary is not specified. + */ + MECAB_ANY_BOUNDARY = 0, + + /** + * The position is a strong token boundary. + */ + MECAB_TOKEN_BOUNDARY = 1, + + /** + * The position is not a token boundary. + */ + MECAB_INSIDE_TOKEN = 2 +}; + +/* C interface */ +#ifdef __cplusplus +#include +#else +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _WIN32 +#include +# ifdef DLL_EXPORT +# define MECAB_DLL_EXTERN __declspec(dllexport) +# define MECAB_DLL_CLASS_EXTERN __declspec(dllexport) +# else +# define MECAB_DLL_EXTERN __declspec(dllimport) +# endif +#endif + +#ifndef MECAB_DLL_EXTERN +# define MECAB_DLL_EXTERN extern +#endif + +#ifndef MECAB_DLL_CLASS_EXTERN +# define MECAB_DLL_CLASS_EXTERN +#endif + + typedef struct mecab_t mecab_t; + typedef struct mecab_model_t mecab_model_t; + typedef struct mecab_lattice_t mecab_lattice_t; + typedef struct mecab_dictionary_info_t mecab_dictionary_info_t; + typedef struct mecab_node_t mecab_node_t; + typedef struct mecab_path_t mecab_path_t; + +#ifndef SWIG + /* C interface */ + + /* old mecab interface */ + /** + * C wrapper of MeCab::Tagger::create(argc, argv) + */ + MECAB_DLL_EXTERN mecab_t* mecab_new(int argc, char **argv); + + /** + * C wrapper of MeCab::Tagger::create(arg) + */ + MECAB_DLL_EXTERN mecab_t* mecab_new2(const char *arg); + + /** + * C wrapper of MeCab::Tagger::version() + */ + MECAB_DLL_EXTERN const char* mecab_version(); + + /** + * C wrapper of MeCab::getLastError() + */ + MECAB_DLL_EXTERN const char* mecab_strerror(mecab_t *mecab); + + /** + * C wrapper of MeCab::deleteTagger(tagger) + */ + MECAB_DLL_EXTERN void mecab_destroy(mecab_t *mecab); + + /** + * C wrapper of MeCab::Tagger:set_partial() + */ + MECAB_DLL_EXTERN int mecab_get_partial(mecab_t *mecab); + + /** + * C wrapper of MeCab::Tagger::partial() + */ + MECAB_DLL_EXTERN void mecab_set_partial(mecab_t *mecab, int partial); + + /** + * C wrapper of MeCab::Tagger::theta() + */ + MECAB_DLL_EXTERN float mecab_get_theta(mecab_t *mecab); + + /** + * C wrapper of MeCab::Tagger::set_theta() + */ + MECAB_DLL_EXTERN void mecab_set_theta(mecab_t *mecab, float theta); + + /** + * C wrapper of MeCab::Tagger::lattice_level() + */ + MECAB_DLL_EXTERN int mecab_get_lattice_level(mecab_t *mecab); + + /** + * C wrapper of MeCab::Tagger::set_lattice_level() + */ + MECAB_DLL_EXTERN void mecab_set_lattice_level(mecab_t *mecab, int level); + + /** + * C wrapper of MeCab::Tagger::all_morphs() + */ + MECAB_DLL_EXTERN int mecab_get_all_morphs(mecab_t *mecab); + + /** + * C wrapper of MeCab::Tagger::set_all_moprhs() + */ + MECAB_DLL_EXTERN void mecab_set_all_morphs(mecab_t *mecab, int all_morphs); + + /** + * C wrapper of MeCab::Tagger::parse(MeCab::Lattice *lattice) + */ + MECAB_DLL_EXTERN int mecab_parse_lattice(mecab_t *mecab, mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Tagger::parse(const char *str) + */ + MECAB_DLL_EXTERN const char* mecab_sparse_tostr(mecab_t *mecab, const char *str); + + /** + * C wrapper of MeCab::Tagger::parse(const char *str, size_t len) + */ + MECAB_DLL_EXTERN const char* mecab_sparse_tostr2(mecab_t *mecab, const char *str, size_t len); + + /** + * C wrapper of MeCab::Tagger::parse(const char *str, char *ostr, size_t olen) + */ + MECAB_DLL_EXTERN char* mecab_sparse_tostr3(mecab_t *mecab, const char *str, size_t len, + char *ostr, size_t olen); + + /** + * C wrapper of MeCab::Tagger::parseToNode(const char *str) + */ + MECAB_DLL_EXTERN const mecab_node_t* mecab_sparse_tonode(mecab_t *mecab, const char*); + + /** + * C wrapper of MeCab::Tagger::parseToNode(const char *str, size_t len) + */ + MECAB_DLL_EXTERN const mecab_node_t* mecab_sparse_tonode2(mecab_t *mecab, const char*, size_t); + + /** + * C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str) + */ + MECAB_DLL_EXTERN const char* mecab_nbest_sparse_tostr(mecab_t *mecab, size_t N, const char *str); + + /** + * C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, size_t len) + */ + MECAB_DLL_EXTERN const char* mecab_nbest_sparse_tostr2(mecab_t *mecab, size_t N, + const char *str, size_t len); + + /** + * C wrapper of MeCab::Tagger::parseNBest(size_t N, const char *str, char *ostr, size_t olen) + */ + MECAB_DLL_EXTERN char* mecab_nbest_sparse_tostr3(mecab_t *mecab, size_t N, + const char *str, size_t len, + char *ostr, size_t olen); + + /** + * C wrapper of MeCab::Tagger::parseNBestInit(const char *str) + */ + MECAB_DLL_EXTERN int mecab_nbest_init(mecab_t *mecab, const char *str); + + /** + * C wrapper of MeCab::Tagger::parseNBestInit(const char *str, size_t len) + */ + MECAB_DLL_EXTERN int mecab_nbest_init2(mecab_t *mecab, const char *str, size_t len); + + /** + * C wrapper of MeCab::Tagger::next() + */ + MECAB_DLL_EXTERN const char* mecab_nbest_next_tostr(mecab_t *mecab); + + /** + * C wrapper of MeCab::Tagger::next(char *ostr, size_t olen) + */ + MECAB_DLL_EXTERN char* mecab_nbest_next_tostr2(mecab_t *mecab, char *ostr, size_t olen); + + /** + * C wrapper of MeCab::Tagger::nextNode() + */ + MECAB_DLL_EXTERN const mecab_node_t* mecab_nbest_next_tonode(mecab_t *mecab); + + /** + * C wrapper of MeCab::Tagger::formatNode(const Node *node) + */ + MECAB_DLL_EXTERN const char* mecab_format_node(mecab_t *mecab, const mecab_node_t *node); + + /** + * C wrapper of MeCab::Tagger::dictionary_info() + */ + MECAB_DLL_EXTERN const mecab_dictionary_info_t* mecab_dictionary_info(mecab_t *mecab); + + /* lattice interface */ + /** + * C wrapper of MeCab::createLattice() + */ + MECAB_DLL_EXTERN mecab_lattice_t *mecab_lattice_new(); + + /** + * C wrapper of MeCab::deleteLattice(lattice) + */ + MECAB_DLL_EXTERN void mecab_lattice_destroy(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::clear() + */ + MECAB_DLL_EXTERN void mecab_lattice_clear(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::is_available() + */ + + MECAB_DLL_EXTERN int mecab_lattice_is_available(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::bos_node() + */ + MECAB_DLL_EXTERN mecab_node_t *mecab_lattice_get_bos_node(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::eos_node() + */ + MECAB_DLL_EXTERN mecab_node_t *mecab_lattice_get_eos_node(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::begin_nodes() + */ + + MECAB_DLL_EXTERN mecab_node_t **mecab_lattice_get_all_begin_nodes(mecab_lattice_t *lattice); + /** + * C wrapper of MeCab::Lattice::end_nodes() + */ + MECAB_DLL_EXTERN mecab_node_t **mecab_lattice_get_all_end_nodes(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::begin_nodes(pos) + */ + MECAB_DLL_EXTERN mecab_node_t *mecab_lattice_get_begin_nodes(mecab_lattice_t *lattice, size_t pos); + + /** + * C wrapper of MeCab::Lattice::end_nodes(pos) + */ + MECAB_DLL_EXTERN mecab_node_t *mecab_lattice_get_end_nodes(mecab_lattice_t *lattice, size_t pos); + + /** + * C wrapper of MeCab::Lattice::sentence() + */ + MECAB_DLL_EXTERN const char *mecab_lattice_get_sentence(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::set_sentence(sentence) + */ + MECAB_DLL_EXTERN void mecab_lattice_set_sentence(mecab_lattice_t *lattice, const char *sentence); + + /** + * C wrapper of MeCab::Lattice::set_sentence(sentence, len) + */ + + MECAB_DLL_EXTERN void mecab_lattice_set_sentence2(mecab_lattice_t *lattice, const char *sentence, size_t len); + + /** + * C wrapper of MeCab::Lattice::size() + */ + MECAB_DLL_EXTERN size_t mecab_lattice_get_size(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::Z() + */ + MECAB_DLL_EXTERN double mecab_lattice_get_z(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::set_Z() + */ + MECAB_DLL_EXTERN void mecab_lattice_set_z(mecab_lattice_t *lattice, double Z); + + /** + * C wrapper of MeCab::Lattice::theta() + */ + MECAB_DLL_EXTERN double mecab_lattice_get_theta(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::set_theta() + */ + + MECAB_DLL_EXTERN void mecab_lattice_set_theta(mecab_lattice_t *lattice, double theta); + + /** + * C wrapper of MeCab::Lattice::next() + */ + MECAB_DLL_EXTERN int mecab_lattice_next(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::request_type() + */ + MECAB_DLL_EXTERN int mecab_lattice_get_request_type(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::has_request_type() + */ + MECAB_DLL_EXTERN int mecab_lattice_has_request_type(mecab_lattice_t *lattice, int request_type); + + /** + * C wrapper of MeCab::Lattice::set_request_type() + */ + MECAB_DLL_EXTERN void mecab_lattice_set_request_type(mecab_lattice_t *lattice, int request_type); + + /** + * C wrapper of MeCab::Lattice::add_request_type() + */ + + MECAB_DLL_EXTERN void mecab_lattice_add_request_type(mecab_lattice_t *lattice, int request_type); + + /** + * C wrapper of MeCab::Lattice::remove_request_type() + */ + MECAB_DLL_EXTERN void mecab_lattice_remove_request_type(mecab_lattice_t *lattice, int request_type); + + /** + * C wrapper of MeCab::Lattice::newNode(); + */ + MECAB_DLL_EXTERN mecab_node_t *mecab_lattice_new_node(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::toString() + */ + MECAB_DLL_EXTERN const char *mecab_lattice_tostr(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::toString(buf, size) + */ + MECAB_DLL_EXTERN const char *mecab_lattice_tostr2(mecab_lattice_t *lattice, char *buf, size_t size); + + /** + * C wrapper of MeCab::Lattice::enumNBestAsString(N) + */ + MECAB_DLL_EXTERN const char *mecab_lattice_nbest_tostr(mecab_lattice_t *lattice, size_t N); + + /** + * C wrapper of MeCab::Lattice::enumNBestAsString(N, buf, size) + */ + + MECAB_DLL_EXTERN const char *mecab_lattice_nbest_tostr2(mecab_lattice_t *lattice, size_t N, char *buf, size_t size); + + /** + * C wrapper of MeCab::Lattice::has_constraint() + */ + MECAB_DLL_EXTERN int mecab_lattice_has_constraint(mecab_lattice_t *lattice); + + /** + * C wrapper of MeCab::Lattice::boundary_constraint(pos) + */ + MECAB_DLL_EXTERN int mecab_lattice_get_boundary_constraint(mecab_lattice_t *lattice, size_t pos); + + + /** + * C wrapper of MeCab::Lattice::feature_constraint(pos) + */ + MECAB_DLL_EXTERN const char *mecab_lattice_get_feature_constraint(mecab_lattice_t *lattice, size_t pos); + + /** + * C wrapper of MeCab::Lattice::boundary_constraint(pos, type) + */ + MECAB_DLL_EXTERN void mecab_lattice_set_boundary_constraint(mecab_lattice_t *lattice, size_t pos, int boundary_type); + + /** + * C wrapper of MeCab::Lattice::set_feature_constraint(begin_pos, end_pos, feature) + */ + MECAB_DLL_EXTERN void mecab_lattice_set_feature_constraint(mecab_lattice_t *lattice, size_t begin_pos, size_t end_pos, const char *feature); + + /** + * C wrapper of MeCab::Lattice::set_result(result); + */ + MECAB_DLL_EXTERN void mecab_lattice_set_result(mecab_lattice_t *lattice, const char *result); + + /** + * C wrapper of MeCab::Lattice::what() + */ + MECAB_DLL_EXTERN const char *mecab_lattice_strerror(mecab_lattice_t *lattice); + + + /* model interface */ + /** + * C wapper of MeCab::Model::create(argc, argv) + */ + MECAB_DLL_EXTERN mecab_model_t *mecab_model_new(int argc, char **argv); + + /** + * C wapper of MeCab::Model::create(arg) + */ + MECAB_DLL_EXTERN mecab_model_t *mecab_model_new2(const char *arg); + + /** + * C wapper of MeCab::deleteModel(model) + */ + + MECAB_DLL_EXTERN void mecab_model_destroy(mecab_model_t *model); + + /** + * C wapper of MeCab::Model::createTagger() + */ + MECAB_DLL_EXTERN mecab_t *mecab_model_new_tagger(mecab_model_t *model); + + /** + * C wapper of MeCab::Model::createLattice() + */ + MECAB_DLL_EXTERN mecab_lattice_t *mecab_model_new_lattice(mecab_model_t *model); + + /** + * C wrapper of MeCab::Model::swap() + */ + MECAB_DLL_EXTERN int mecab_model_swap(mecab_model_t *model, mecab_model_t *new_model); + + /** + * C wapper of MeCab::Model::dictionary_info() + */ + MECAB_DLL_EXTERN const mecab_dictionary_info_t* mecab_model_dictionary_info(mecab_model_t *model); + + /** + * C wrapper of MeCab::Model::transition_cost() + */ + MECAB_DLL_EXTERN int mecab_model_transition_cost(mecab_model_t *model, + unsigned short rcAttr, + unsigned short lcAttr); + + /** + * C wrapper of MeCab::Model::lookup() + */ + MECAB_DLL_EXTERN mecab_node_t *mecab_model_lookup(mecab_model_t *model, + const char *begin, + const char *end, + mecab_lattice_t *lattice); + + /* static functions */ + MECAB_DLL_EXTERN int mecab_do(int argc, char **argv); + MECAB_DLL_EXTERN int mecab_dict_index(int argc, char **argv); + MECAB_DLL_EXTERN int mecab_dict_gen(int argc, char **argv); + MECAB_DLL_EXTERN int mecab_cost_train(int argc, char **argv); + MECAB_DLL_EXTERN int mecab_system_eval(int argc, char **argv); + MECAB_DLL_EXTERN int mecab_test_gen(int argc, char **argv); +#endif + +#ifdef __cplusplus +} +#endif + +/* C++ interface */ +#ifdef __cplusplus + +namespace MeCab { +typedef struct mecab_dictionary_info_t DictionaryInfo; +typedef struct mecab_path_t Path; +typedef struct mecab_node_t Node; + +template class Allocator; +class Tagger; + +/** + * Lattice class + */ +class MECAB_DLL_CLASS_EXTERN Lattice { +public: + /** + * Clear all internal lattice data. + */ + virtual void clear() = 0; + + /** + * Return true if result object is available. + * @return boolean + */ + virtual bool is_available() const = 0; + + /** + * Return bos (begin of sentence) node. + * You can obtain all nodes via "for (const Node *node = lattice->bos_node(); node; node = node->next) {}" + * @return bos node object + */ + virtual Node *bos_node() const = 0; + + /** + * Return eos (end of sentence) node. + * @return eos node object + */ + virtual Node *eos_node() const = 0; + +#ifndef SWIG + /** + * This method is used internally. + */ + virtual Node **begin_nodes() const = 0; + + /** + * This method is used internally. + */ + virtual Node **end_nodes() const = 0; +#endif + + /** + * Return node linked list ending at |pos|. + * You can obtain all nodes via "for (const Node *node = lattice->end_nodes(pos); node; node = node->enext) {}" + * @param pos position of nodes. 0 <= pos < size() + * @return node linked list + */ + virtual Node *end_nodes(size_t pos) const = 0; + + /** + * Return node linked list starting at |pos|. + * You can obtain all nodes via "for (const Node *node = lattice->begin_nodes(pos); node; node = node->bnext) {}" + * @param pos position of nodes. 0 <= pos < size() + * @return node linked list + */ + virtual Node *begin_nodes(size_t pos) const = 0; + + /** + * Return sentence. + * If MECAB_NBEST or MECAB_PARTIAL mode is off, the returned poiner is the same as the one set by set_sentence(). + * @return sentence + */ + virtual const char *sentence() const = 0; + + /** + * Set sentence. This method does not take the ownership of the object. + * @param sentence sentence + */ + virtual void set_sentence(const char *sentence) = 0; + +#ifndef SWIG + /** + * Set sentence. This method does not take the ownership of the object. + * @param sentence sentence + * @param len length of the sentence + */ + virtual void set_sentence(const char *sentence, size_t len) = 0; +#endif + + /** + * Return sentence size. + * @return sentence size + */ + virtual size_t size() const = 0; + + /** + * Set normalization factor of CRF. + * @param Z new normalization factor. + */ + virtual void set_Z(double Z) = 0; + + /** + * return normalization factor of CRF. + * @return normalization factor. + */ + virtual double Z() const = 0; + + /** + * Set temparature parameter theta. + * @param theta temparature parameter. + */ + virtual void set_theta(float theta) = 0; + + /** + * Return temparature parameter theta. + * @return temparature parameter. + */ + virtual float theta() const = 0; + + /** + * Obtain next-best result. The internal linked list structure is updated. + * You should set MECAB_NBEST reques_type in advance. + * Return false if no more results are available or request_type is invalid. + * @return boolean + */ + virtual bool next() = 0; + + /** + * Return the current request type. + * @return request type + */ + virtual int request_type() const = 0; + + /** + * Return true if the object has a specified request type. + * @return boolean + */ + virtual bool has_request_type(int request_type) const = 0; + + /** + * Set request type. + * @param request_type new request type assigned + */ + virtual void set_request_type(int request_type) = 0; + + /** + * Add request type. + * @param request_type new request type added + */ + virtual void add_request_type(int request_type) = 0; + + /** + * Remove request type. + * @param request_type new request type removed + */ + virtual void remove_request_type(int request_type) = 0; + +#ifndef SWIG + /** + * This method is used internally. + */ + virtual Allocator *allocator() const = 0; +#endif + + /** + * Return new node. Lattice objects has the ownership of the node. + * @return new node object + */ + virtual Node *newNode() = 0; + + /** + * Return string representation of the lattice. + * Returned object is managed by this instance. When clear/set_sentence() method + * is called, the returned buffer is initialized. + * @return string representation of the lattice + */ + virtual const char *toString() = 0; + + /** + * Return string representation of the node. + * Returned object is managed by this instance. When clear/set_sentence() method + * is called, the returned buffer is initialized. + * @return string representation of the node + * @param node node object + */ + virtual const char *toString(const Node *node) = 0; + + /** + * Return string representation of the N-best results. + * Returned object is managed by this instance. When clear/set_sentence() method + * is called, the returned buffer is initialized. + * @return string representation of the node + * @param N how many results you want to obtain + */ + virtual const char *enumNBestAsString(size_t N) = 0; + +#ifndef SWIG + /** + * Return string representation of the lattice. + * Result is saved in the specified buffer. + * @param buf output buffer + * @param size output buffer size + * @return string representation of the lattice + */ + virtual const char *toString(char *buf, size_t size) = 0; + + /** + * Return string representation of the node. + * Result is saved in the specified buffer. + * @param node node object + * @param buf output buffer + * @param size output buffer size + * @return string representation of the lattice + */ + virtual const char *toString(const Node *node, + char *buf, size_t size) = 0; + + /** + * Return string representation of the N-best result. + * Result is saved in the specified. + * @param N how many results you want to obtain + * @param buf output buffer + * @param size output buffer size + * @return string representation of the lattice + */ + virtual const char *enumNBestAsString(size_t N, char *buf, size_t size) = 0; +#endif + + /** + * Returns true if any parsing constraint is set + */ + virtual bool has_constraint() const = 0; + + /** + * Returns the boundary constraint at the position. + * @param pos the position of constraint + * @return boundary constraint type + */ + virtual int boundary_constraint(size_t pos) const = 0; + + /** + * Returns the token constraint at the position. + * @param pos the beginning position of constraint. + * @return constrained node starting at the position. + */ + virtual const char *feature_constraint(size_t pos) const = 0; + + /** + * Set parsing constraint for partial parsing mode. + * @param pos the position of the boundary + * @param boundary_constraint_type the type of boundary + */ + virtual void set_boundary_constraint(size_t pos, + int boundary_constraint_type) = 0; + + /** + * Set parsing constraint for partial parsing mode. + * @param begin_pos the starting position of the constrained token. + * @param end_pos the the ending position of the constrained token. + * @param feature the feature of the constrained token. + */ + virtual void set_feature_constraint( + size_t begin_pos, size_t end_pos, + const char *feature) = 0; + + /** + * Set golden parsing results for unittesting. + * @param result the parsing result written in the standard mecab output. + */ + virtual void set_result(const char *result) = 0; + + /** + * Return error string. + * @return error string + */ + virtual const char *what() const = 0; + + /** + * Set error string. given string is copied to the internal buffer. + * @param str new error string + */ + virtual void set_what(const char *str) = 0; + +#ifndef SWIG + /** + * Create new Lattice object + * @return new Lattice object + */ + static Lattice *create(); +#endif + + virtual ~Lattice() {} +}; + +/** + * Model class + */ +class MECAB_DLL_CLASS_EXTERN Model { +public: + /** + * Return DictionaryInfo linked list. + * @return DictionaryInfo linked list + */ + virtual const DictionaryInfo *dictionary_info() const = 0; + + /** + * Return transtion cost from rcAttr to lcAttr. + * @return transtion cost + */ + virtual int transition_cost(unsigned short rcAttr, + unsigned short lcAttr) const = 0; + + /** + * perform common prefix search from the range [begin, end). + * |lattice| takes the ownership of return value. + * @return node linked list. + */ + virtual Node *lookup(const char *begin, const char *end, + Lattice *lattice) const = 0; + + /** + * Create a new Tagger object. + * All returned tagger object shares this model object as a parsing model. + * Never delete this model object before deleting tagger object. + * @return new Tagger object + */ + virtual Tagger *createTagger() const = 0; + + /** + * Create a new Lattice object. + * @return new Lattice object + */ + virtual Lattice *createLattice() const = 0; + + /** + * Swap the instance with |model|. + * The ownership of |model| always moves to this instance, + * meaning that passed |model| will no longer be accessible after calling this method. + * return true if new model is swapped successfully. + * This method is thread safe. All taggers created by + * Model::createTagger() method will also be updated asynchronously. + * No need to stop the parsing thread excplicitly before swapping model object. + * @return boolean + * @param model new model which is going to be swapped with the current model. + */ + virtual bool swap(Model *model) = 0; + + /** + * Return a version string + * @return version string + */ + static const char *version(); + + virtual ~Model() {} + +#ifndef SWIG + /** + * Factory method to create a new Model with a specified main's argc/argv-style parameters. + * Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + * cause of the errors. + * @return new Model object + * @param argc number of parameters + * @param argv parameter list + */ + static Model* create(int argc, char **argv); + + /** + * Factory method to create a new Model with a string parameter representation, i.e., + * "-d /user/local/mecab/dic/ipadic -Ochasen". + * Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + * cause of the errors. + * @return new Model object + * @param arg single string representation of the argment. + */ + static Model* create(const char *arg); +#endif +}; + +/** + * Tagger class + */ +class MECAB_DLL_CLASS_EXTERN Tagger { +public: + /** + * Handy static method. + * Return true if lattice is parsed successfully. + * This function is equivalent to + * { + * Tagger *tagger = model.createModel(); + * cosnt bool result = tagger->parse(lattice); + * delete tagger; + * return result; + * } + * @return boolean + */ + static bool parse(const Model &model, Lattice *lattice); + + /** + * Parse lattice object. + * Return true if lattice is parsed successfully. + * A sentence must be set to the lattice with Lattice:set_sentence object before calling this method. + * Parsed node object can be obtained with Lattice:bos_node. + * This method is thread safe. + * @return lattice lattice object + * @return boolean + */ + virtual bool parse(Lattice *lattice) const = 0; + + /** + * Parse given sentence and return parsed result as string. + * You should not delete the returned string. The returned buffer + * is overwritten when parse method is called again. + * This method is NOT thread safe. + * @param str sentence + * @return parsed result + */ + virtual const char* parse(const char *str) = 0; + + /** + * Parse given sentence and return Node object. + * You should not delete the returned node object. The returned buffer + * is overwritten when parse method is called again. + * You can traverse all nodes via Node::next member. + * This method is NOT thread safe. + * @param str sentence + * @return bos node object + */ + virtual const Node* parseToNode(const char *str) = 0; + + /** + * Parse given sentence and obtain N-best results as a string format. + * Currently, N must be 1 <= N <= 512 due to the limitation of the buffer size. + * You should not delete the returned string. The returned buffer + * is overwritten when parse method is called again. + * This method is DEPRECATED. Use Lattice class. + * @param N how many results you want to obtain + * @param str sentence + * @return parsed result + */ + virtual const char* parseNBest(size_t N, const char *str) = 0; + + /** + * Initialize N-best enumeration with a sentence. + * Return true if initialization finishes successfully. + * N-best result is obtained by calling next() or nextNode() in sequence. + * This method is NOT thread safe. + * This method is DEPRECATED. Use Lattice class. + * @param str sentence + * @return boolean + */ + virtual bool parseNBestInit(const char *str) = 0; + + /** + * Return next-best parsed result. You must call parseNBestInit() in advance. + * Return NULL if no more reuslt is available. + * This method is NOT thread safe. + * This method is DEPRECATED. Use Lattice class. + * @return node object + */ + virtual const Node* nextNode() = 0; + + /** + * Return next-best parsed result. You must call parseNBestInit() in advance. + * Return NULL if no more reuslt is available. + * This method is NOT thread safe. + * This method is DEPRECATED. Use Lattice class. + * @return parsed result + */ + virtual const char* next() = 0; + + /** + * Return formatted node object. The format is specified with + * --unk-format, --bos-format, --eos-format, and --eon-format respectively. + * You should not delete the returned string. The returned buffer + * is overwritten when parse method is called again. + * This method is NOT thread safe. + * This method is DEPRECATED. Use Lattice class. + * @param node node object. + * @return parsed result + */ + virtual const char* formatNode(const Node *node) = 0; + +#ifndef SWIG + /** + * The same as parse() method, but input length and output buffer are passed. + * Return parsed result as string. The result pointer is the same as |ostr|. + * Return NULL, if parsed result string cannot be stored within |olen| bytes. + * @param str sentence + * @param len sentence length + * @param ostr output buffer + * @param olen output buffer length + * @return parsed result + */ + virtual const char* parse(const char *str, size_t len, char *ostr, size_t olen) = 0; + + /** + * The same as parse() method, but input length can be passed. + * @param str sentence + * @param len sentence length + * @return parsed result + */ + virtual const char* parse(const char *str, size_t len) = 0; + + /** + * The same as parseToNode(), but input lenth can be passed. + * @param str sentence + * @param len sentence length + * @return node object + */ + virtual const Node* parseToNode(const char *str, size_t len) = 0; + + /** + * The same as parseNBest(), but input length can be passed. + * @param N how many results you want to obtain + * @param str sentence + * @param len sentence length + * @return parsed result + */ + virtual const char* parseNBest(size_t N, const char *str, size_t len) = 0; + + /** + * The same as parseNBestInit(), but input length can be passed. + * @param str sentence + * @param len sentence length + * @return boolean + * @return parsed result + */ + virtual bool parseNBestInit(const char *str, size_t len) = 0; + + /** + * The same as next(), but output buffer can be passed. + * Return NULL if more than |olen| buffer is required to store output string. + * @param ostr output buffer + * @param olen output buffer length + * @return parsed result + */ + virtual const char* next(char *ostr , size_t olen) = 0; + + /** + * The same as parseNBest(), but input length and output buffer can be passed. + * Return NULL if more than |olen| buffer is required to store output string. + * @param N how many results you want to obtain + * @param str input sentence + * @param len input sentence length + * @param ostr output buffer + * @param olen output buffer length + * @return parsed result + */ + virtual const char* parseNBest(size_t N, const char *str, + size_t len, char *ostr, size_t olen) = 0; + + /** + * The same as formatNode(), but output buffer can be passed. + * Return NULL if more than |olen| buffer is required to store output string. + * @param node node object + * @param ostr output buffer + * @param olen output buffer length + * @return parsed result + */ + virtual const char* formatNode(const Node *node, char *ostr, size_t olen) = 0; +#endif + + /** + * Set request type. + * This method is DEPRECATED. Use Lattice::set_request_type(MECAB_PARTIAL). + * @param request_type new request type assigned + */ + virtual void set_request_type(int request_type) = 0; + + /** + * Return the current request type. + * This method is DEPRECATED. Use Lattice class. + * @return request type + */ + virtual int request_type() const = 0; + + /** + * Return true if partial parsing mode is on. + * This method is DEPRECATED. Use Lattice::has_request_type(MECAB_PARTIAL). + * @return boolean + */ + virtual bool partial() const = 0; + + /** + * set partial parsing mode. + * This method is DEPRECATED. Use Lattice::add_request_type(MECAB_PARTIAL) or Lattice::remove_request_type(MECAB_PARTIAL) + * @param partial partial mode + */ + virtual void set_partial(bool partial) = 0; + + /** + * Return lattice level. + * This method is DEPRECATED. Use Lattice::*_request_type() + * @return int lattice level + */ + virtual int lattice_level() const = 0; + + /** + * Set lattice level. + * This method is DEPRECATED. Use Lattice::*_request_type() + * @param level lattice level + */ + virtual void set_lattice_level(int level) = 0; + + /** + * Return true if all morphs output mode is on. + * This method is DEPRECATED. Use Lattice::has_request_type(MECAB_ALL_MORPHS). + * @return boolean + */ + virtual bool all_morphs() const = 0; + + /** + * set all-morphs output mode. + * This method is DEPRECATED. Use Lattice::add_request_type(MECAB_ALL_MORPHS) or Lattice::remove_request_type(MECAB_ALL_MORPHS) + * @param all_morphs + */ + virtual void set_all_morphs(bool all_morphs) = 0; + + /** + * Set temparature parameter theta. + * @param theta temparature parameter. + */ + virtual void set_theta(float theta) = 0; + + /** + * Return temparature parameter theta. + * @return temparature parameter. + */ + virtual float theta() const = 0; + + /** + * Return DictionaryInfo linked list. + * @return DictionaryInfo linked list + */ + virtual const DictionaryInfo* dictionary_info() const = 0; + + /** + * Return error string. + * @return error string + */ + virtual const char* what() const = 0; + + virtual ~Tagger() {} + +#ifndef SWIG + /** + * Factory method to create a new Tagger with a specified main's argc/argv-style parameters. + * Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + * cause of the errors. + * @return new Tagger object + * @param argc number of parameters + * @param argv parameter list + */ + static Tagger *create(int argc, char **argv); + + /** + * Factory method to create a new Tagger with a string parameter representation, i.e., + * "-d /user/local/mecab/dic/ipadic -Ochasen". + * Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the + * cause of the errors. + * @return new Model object + * @param arg single string representation of the argment. + */ + static Tagger *create(const char *arg); +#endif + + /** + * Return a version string + * @return version string + */ + static const char *version(); +}; + +#ifndef SWIG +/** + * Alias of Lattice::create() + */ +MECAB_DLL_EXTERN Lattice *createLattice(); + +/** + * Alias of Mode::create(argc, argv) + */ +MECAB_DLL_EXTERN Model *createModel(int argc, char **argv); + +/** + * Alias of Mode::create(arg) + */ +MECAB_DLL_EXTERN Model *createModel(const char *arg); + +/** + * Alias of Tagger::create(argc, argv) + */ +MECAB_DLL_EXTERN Tagger *createTagger(int argc, char **argv); + +/** + * Alias of Tagger::create(arg) + */ +MECAB_DLL_EXTERN Tagger *createTagger(const char *arg); + +/** + * delete Lattice object. + * This method calles "delete lattice". + * In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + * @param lattice lattice object + */ +MECAB_DLL_EXTERN void deleteLattice(Lattice *lattice); + + +/** + * delete Model object. + * This method calles "delete model". + * In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + * @param model model object + */ +MECAB_DLL_EXTERN void deleteModel(Model *model); + +/** + * delete Tagger object. + * This method calles "delete tagger". + * In some environment, e.g., MS-Windows, an object allocated inside a DLL must be deleted in the same DLL too. + * @param tagger tagger object + */ +MECAB_DLL_EXTERN void deleteTagger(Tagger *tagger); + +/** + * Return last error string. + * @return error string + */ +MECAB_DLL_EXTERN const char* getLastError(); + +/** + * An alias of getLastError. + * It is kept for backward compatibility. + * @return error string + */ +MECAB_DLL_EXTERN const char* getTaggerError(); +#endif +} +#endif +#endif /* MECAB_MECAB_H_ */ diff --git a/mecab/python/setup.py b/mecab/python/setup.py index 4486cbb..ee1da4a 100644 --- a/mecab/python/setup.py +++ b/mecab/python/setup.py @@ -1,21 +1,36 @@ #!/usr/bin/env python -from distutils.core import setup,Extension,os -import string +from setuptools import setup, Extension -def cmd1(str): - return os.popen(str).readlines()[0][:-1] -def cmd2(str): - return string.split (cmd1(str)) - -setup(name = "mecab-python", - version = cmd1("mecab-config --version"), +setup( + name="mecab-python-windows", + version="0.9.9.6", py_modules=["MeCab"], - ext_modules = [ - Extension("_MeCab", + ext_modules=[ + Extension( + "_MeCab", ["MeCab_wrap.cxx",], - include_dirs=cmd2("mecab-config --inc-dir"), - library_dirs=cmd2("mecab-config --libs-only-L"), - libraries=cmd2("mecab-config --libs-only-l")) - ]) + include_dirs=["C:\Program Files (x86)\MeCab\sdk"], + library_dirs=["C:\Program Files (x86)\MeCab\sdk"], + libraries=["libmecab"] + ) + ], + author='Yukino Ikegami', + author_email='yknikgm@gmail.com', + platforms=['Windows'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Operating System :: Microsoft', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.6', + 'Topic :: Text Processing' + ], + description='Python wrapper for MeCab on Windows: Morphological Analysis engine', + long_description='''This is a python wrapper for MeCab. It works on Windows. + +License +--------- +MeCab is copyrighted free software by Taku Kudo and Nippon Telegraph and Telephone Corporation, and is released under any of the GPL (see the file GPL), the LGPL (see the file LGPL), or the BSD License (see the file BSD). +''' +) \ No newline at end of file diff --git a/mecab/python/setup64.py b/mecab/python/setup64.py new file mode 100644 index 0000000..6592e71 --- /dev/null +++ b/mecab/python/setup64.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +from setuptools import setup, Extension + + +setup( + name="mecab-python-windows", + version="0.9.9.6", + py_modules=["MeCab"], + ext_modules=[ + Extension( + "_MeCab", + ["MeCab_wrap.cxx",], + include_dirs=["C:\Program Files\MeCab\sdk"], + library_dirs=["C:\Program Files\MeCab\sdk"], + libraries=["libmecab"] + ) + ], + author='Yukino Ikegami', + author_email='yknikgm@gmail.com', + platforms=['Windows'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Operating System :: Microsoft', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.6', + 'Topic :: Text Processing' + ], + description='Python wrapper for MeCab on Windows: Morphological Analysis engine', + long_description='''This is a python wrapper for MeCab. It works on Windows. + +License +--------- +MeCab is copyrighted free software by Taku Kudo and Nippon Telegraph and Telephone Corporation, and is released under any of the GPL (see the file GPL), the LGPL (see the file LGPL), or the BSD License (see the file BSD). +''' +) \ No newline at end of file diff --git a/mecab/python/version.h b/mecab/python/version.h new file mode 100644 index 0000000..b7fbc39 --- /dev/null +++ b/mecab/python/version.h @@ -0,0 +1,3 @@ +namespace MeCab { +# define VERSION "0.996" +} diff --git a/mecab/src/Makefile.msvc.in b/mecab/src/Makefile.msvc.in index 7d10a5e..a84779a 100644 --- a/mecab/src/Makefile.msvc.in +++ b/mecab/src/Makefile.msvc.in @@ -3,10 +3,10 @@ CXXC = cl.exe LINK=link.exe CFLAGS = /EHsc /O2 /GL /GA /Ob2 /nologo /W3 /MT /Zi /wd4800 /wd4305 /wd4244 -LDFLAGS = /nologo /OPT:REF /OPT:ICF /LTCG /NXCOMPAT /DYNAMICBASE /MACHINE:X86 ADVAPI32.LIB +LDFLAGS = /nologo /OPT:REF /OPT:ICF /LTCG /NXCOMPAT /DYNAMICBASE /MACHINE:X64 ADVAPI32.LIB DEFS = -D_CRT_SECURE_NO_DEPRECATE -DMECAB_USE_THREAD \ - -DDLL_EXPORT -DHAVE_GETENV -DHAVE_WINDOWS_H -DDIC_VERSION=@DIC_VERSION@ \ - -DVERSION="\"@VERSION@\"" -DPACKAGE="\"mecab\"" \ + -DDLL_EXPORT -DHAVE_GETENV -DHAVE_WINDOWS_H -DDIC_VERSION=102 \ + -DVERSION="\"0.996\"" -DPACKAGE="\"mecab\"" \ -DUNICODE -D_UNICODE \ -DMECAB_DEFAULT_RC="\"c:\\Program Files\\mecab\\etc\\mecabrc\"" INC = -I. -I.. diff --git a/mecab/src/common.h b/mecab/src/common.h index d1fc459..6f1d7b4 100644 --- a/mecab/src/common.h +++ b/mecab/src/common.h @@ -14,6 +14,7 @@ #include #include #include +#include #ifdef __CYGWIN__ #define _GLIBCXX_EXPORT_TEMPLATE @@ -81,17 +82,10 @@ #define EXIT_SUCCESS 0 #endif -#ifdef _WIN32 -#ifdef __GNUC__ -#define WPATH_FORCE(path) (MeCab::Utf8ToWide(path).c_str()) -#define WPATH(path) (path) -#else -#define WPATH(path) WPATH_FORCE(path) -#endif -#else + #define WPATH_FORCE(path) (path) #define WPATH(path) (path) -#endif + namespace MeCab { class die { diff --git a/mecab/src/feature_index.cpp b/mecab/src/feature_index.cpp index 051bdf8..623da17 100644 --- a/mecab/src/feature_index.cpp +++ b/mecab/src/feature_index.cpp @@ -353,7 +353,7 @@ bool FeatureIndex::buildUnigramFeature(LearnerPath *path, if (!r) goto NEXT; os_ << r; } break; - case 't': os_ << (size_t)path->rnode->char_type; break; + case 't': os_ << (unsigned int)path->rnode->char_type; break; case 'u': os_ << ufeature; break; case 'w': if (path->rnode->stat == MECAB_NOR_NODE) { diff --git a/mecab/src/make.bat b/mecab/src/make.bat index f782e52..5f1252a 100755 --- a/mecab/src/make.bat +++ b/mecab/src/make.bat @@ -3,6 +3,6 @@ Set INCLUDE=c:\Program Files\Microsoft Visual Studio 8\VC\include;c:\Program Fil Set LIB=c:\Program Files\Microsoft Visual Studio 8\VC\lib;c:\Program Files\Microsoft Platform SDK\Lib;%LIB% Set COMSPEC=cmd.exe rem nmake -f Makefile.msvc clean -nmake -f Makefile.msvc +nmake -f Makefile.msvc.in diff --git a/mecab/src/mmap.h b/mecab/src/mmap.h index 63243ca..9e96096 100644 --- a/mecab/src/mmap.h +++ b/mecab/src/mmap.h @@ -104,7 +104,7 @@ template class Mmap { CHECK_FALSE(false) << "unknown open mode:" << filename; } - hFile = ::CreateFileW(WPATH_FORCE(filename), mode1, FILE_SHARE_READ, 0, + hFile = ::CreateFileA(WPATH(filename), mode1, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); CHECK_FALSE(hFile != INVALID_HANDLE_VALUE) << "CreateFile() failed: " << filename; diff --git a/mecab/src/utils.cpp b/mecab/src/utils.cpp index fe86657..39bfc0c 100644 --- a/mecab/src/utils.cpp +++ b/mecab/src/utils.cpp @@ -25,7 +25,7 @@ #include #endif -#include +#include #if defined(_WIN32) && !defined(__CYGWIN__) extern HINSTANCE DllInstance; diff --git a/mecab/src/utils.h b/mecab/src/utils.h index ea5c9e9..faadf71 100644 --- a/mecab/src/utils.h +++ b/mecab/src/utils.h @@ -19,7 +19,7 @@ #endif #ifdef HAVE_STDINT_H -#include +#include #else // HAVE_STDINT_H #if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_MSC_VER) && (_MSC_VER <= 1500) @@ -27,7 +27,7 @@ typedef unsigned char uint8_t; typedef unsigned long uint32_t; typedef unsigned long long uint64_t; #else // _MSC_VER -#include +#include #endif // _MSC_VER #else // _WIN32 typedef unsigned char uint8_t; diff --git a/mecab/src/vc140.pdb b/mecab/src/vc140.pdb new file mode 100644 index 0000000..b2cb28d Binary files /dev/null and b/mecab/src/vc140.pdb differ diff --git a/mecab/src/vc90.pdb b/mecab/src/vc90.pdb new file mode 100644 index 0000000..89cd3ca Binary files /dev/null and b/mecab/src/vc90.pdb differ diff --git a/mecab/src/writer.cpp b/mecab/src/writer.cpp index ed68767..6643338 100644 --- a/mecab/src/writer.cpp +++ b/mecab/src/writer.cpp @@ -257,7 +257,7 @@ bool Writer::writeNode(Lattice *lattice, // input sentence case 'S': os->write(lattice->sentence(), lattice->size()); break; // sentence length - case 'L': *os << lattice->size(); break; + case 'L': *os << (unsigned int)lattice->size(); break; // morph case 'm': os->write(node->surface, node->length); break; case 'M': os->write(reinterpret_cast