--- Begin Message ---
Package: python-mecab
Version: 0.99.3-1
Severity: normal
The source of python-mecab is generated by swig (version from 2009) in
the subdirectory of swig in mecab package.
Since upstrean manually copy such previosly generated file to make a
release tar of this package, it is not updated with recent python
changes.
I have reported this to upstream.
https://code.google.com/p/mecab/issues/detail?id=7
Please note setup.py needs to be patched.
In the mean time, you can update package via patch :-)
Oh, when you do this, please remove debian/pycompat and add XB-...
following https://wiki.debian.org/Python/Packaging
See #538978 and #597105 bugs for how to work around python3.
Attached patch is quick and dirty package I made and working here
(except some dependency entries are not properly generated to be good
enough for upload. Please fix them before upload.)
FYI: Here is MeCab working under python3.
Yes, it is much easier to use interactively under UTF-8!
No more UTF-8 string encoded into ascii.
$ python3
Python 3.3.2+ (default, Aug 4 2013, 15:50:24)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, MeCab
>>> m = MeCab.Tagger ("-Ochasen")
>>> m.parse ("今日もしないとね")
'今日\tキョウ\t今日\t名詞-副詞可能\t\t\nも\tモ\tも\t助詞-係助詞\t\t\nし\tシ\tする\t動詞-自立\tサ変・スル\t未然形\nない\tナイ\tない\t助動詞\t特殊・ナイ\t基本形\nと\tト\tと\t助詞-接続助詞\t\t\nね\tネ\tね\t助詞-終助詞\t\t\nEOS\n'
>>> print(m.parse ("今日もしないとね"))
今日 キョウ 今日 名詞-副詞可能
も モ も 助詞-係助詞
し シ する 動詞-自立 サ変・スル 未然形
ない ナイ ない 助動詞 特殊・ナイ 基本形
と ト と 助詞-接続助詞
ね ネ ね 助詞-終助詞
EOS
----------------
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (100,
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.2.0-4-rt-amd64 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-mecab depends on:
ii libc6 2.17-92
ii libgcc1 1:4.8.1-8
ii libmecab2 0.99.3-3
ii libstdc++6 4.8.1-8
ii python 2.7.5-3
Versions of packages python-mecab recommends:
ii mecab-ipadic 2.7.0-20070801+main-1
ii mecab-jumandic 5.1+20070304-3
python-mecab suggests no packages.
-- no debconf information
diff -Nru python-mecab-0.99.3/debian/changelog python-mecab-0.99.3/debian/changelog
--- python-mecab-0.99.3/debian/changelog 2012-03-31 18:13:28.000000000 +0900
+++ python-mecab-0.99.3/debian/changelog 2013-08-12 14:05:41.000000000 +0900
@@ -1,3 +1,10 @@
+python-mecab (0.99.3-1.1) UNRELEASED; urgency=low
+
+ * Non-maintainer upload.
+ * python3
+
+ -- Osamu Aoki <[email protected]> Mon, 12 Aug 2013 14:05:31 +0900
+
python-mecab (0.99.3-1) unstable; urgency=low
[ Jakub Wilk ]
diff -Nru python-mecab-0.99.3/debian/compat python-mecab-0.99.3/debian/compat
--- python-mecab-0.99.3/debian/compat 2010-12-28 17:41:05.000000000 +0900
+++ python-mecab-0.99.3/debian/compat 2013-08-12 15:15:25.000000000 +0900
@@ -1 +1 @@
-7
+9
diff -Nru python-mecab-0.99.3/debian/control python-mecab-0.99.3/debian/control
--- python-mecab-0.99.3/debian/control 2012-03-31 15:59:27.000000000 +0900
+++ python-mecab-0.99.3/debian/control 2013-08-12 15:36:02.000000000 +0900
@@ -3,17 +3,20 @@
Priority: optional
Maintainer: Debian Python Modules Team <[email protected]>
Uploaders: TANIGUCHI Takaki <[email protected]>
-Build-Depends: debhelper (>= 7), python-all-dev, libmecab-dev (>= 0.99.3)
-Standards-Version: 3.9.3
+Build-Depends: debhelper (>= 9), python-all-dev, python3-all-dev, libmecab-dev (>= 0.99.3)
+Standards-Version: 3.9.4
Homepage: http://sourceforge.net/projects/mecab/
Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-mecab/trunk/
Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-mecab/trunk/
Package: python-mecab
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends},
- mecab-jumandic | mecab-ipadic
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ ${python:Depends}, ${python3:Depends}
+Recommends: mecab-jumandic | mecab-ipadic
Provides: ${python:Provides}
+XB-Python-Version: ${python:Versions}
+XB-Python3-Version: ${python3:Versions}
Description: mecab binding for Python
Mecab is a morphological analysis system. It reads Japanese
sentences from the standard input, segments them into morpheme
diff -Nru python-mecab-0.99.3/debian/patches/0001-modernize-setup.py python-mecab-0.99.3/debian/patches/0001-modernize-setup.py
--- python-mecab-0.99.3/debian/patches/0001-modernize-setup.py 1970-01-01 09:00:00.000000000 +0900
+++ python-mecab-0.99.3/debian/patches/0001-modernize-setup.py 2013-08-12 14:09:13.000000000 +0900
@@ -0,0 +1,20 @@
+--- a/setup.py
++++ b/setup.py
+@@ -1,13 +1,12 @@
+ #!/usr/bin/env python
+
+ from distutils.core import setup,Extension,os
+-import string
+
+-def cmd1(str):
+- return os.popen(str).readlines()[0][:-1]
++def cmd1(st):
++ return os.popen(st).readlines()[0][:-1]
+
+-def cmd2(str):
+- return string.split (cmd1(str))
++def cmd2(st):
++ return str.split (cmd1(st))
+
+ setup(name = "mecab-python",
+ version = cmd1("mecab-config --version"),
diff -Nru python-mecab-0.99.3/debian/patches/0002-update-swig-files.py python-mecab-0.99.3/debian/patches/0002-update-swig-files.py
--- python-mecab-0.99.3/debian/patches/0002-update-swig-files.py 1970-01-01 09:00:00.000000000 +0900
+++ python-mecab-0.99.3/debian/patches/0002-update-swig-files.py 2013-08-12 14:12:43.000000000 +0900
@@ -0,0 +1,1841 @@
+--- a/MeCab.py
++++ b/MeCab.py
+@@ -1,9 +1,10 @@
+ # This file was automatically generated by SWIG (http://www.swig.org).
+-# Version 1.3.40
++# Version 2.0.9
+ #
+ # Do not make changes to this file unless you know what you are doing--modify
+ # the SWIG interface file instead.
+-# This file is compatible with both classic and new-style classes.
++
++
+
+ from sys import version_info
+ if version_info >= (2,6,0):
+@@ -39,7 +40,7 @@
+ return
+ method = class_type.__swig_setmethods__.get(name,None)
+ if method: return method(self,value)
+- if (not static) or hasattr(self,name):
++ if (not static):
+ self.__dict__[name] = value
+ else:
+ raise AttributeError("You cannot add attributes to %s" % self)
+@@ -307,5 +308,6 @@
+ Tagger_version = _MeCab.Tagger_version
+
+ VERSION = _MeCab.VERSION
++# This file is compatible with both classic and new-style classes.
+
+
+--- a/MeCab_wrap.cxx
++++ b/MeCab_wrap.cxx
+@@ -1,6 +1,6 @@
+ /* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+- * Version 1.3.40
++ * Version 2.0.9
+ *
+ * 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
+@@ -147,7 +147,6 @@
+
+ /* Python.h has to appear first */
+ #include <Python.h>
+-#include <stddef.h>
+
+ /* -----------------------------------------------------------------------------
+ * swigrun.swg
+@@ -202,7 +201,7 @@
+ /*
+ Flags/methods for returning states.
+
+- The SWIG conversion methods, as ConvertPtr, return and 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).
+
+@@ -757,7 +756,16 @@
+ #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)
++#define PyString_AsString(str) PyBytes_AsString(str)
++#define PyString_Size(str) PyBytes_Size(str)
++#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
++#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
++#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
++#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
+
+ #endif
+
+@@ -897,6 +905,67 @@
+ typedef int Py_ssize_t;
+ # define PY_SSIZE_T_MAX INT_MAX
+ # define PY_SSIZE_T_MIN INT_MIN
++typedef inquiry lenfunc;
++typedef intargfunc ssizeargfunc;
++typedef intintargfunc ssizessizeargfunc;
++typedef intobjargproc ssizeobjargproc;
++typedef intintobjargproc ssizessizeobjargproc;
++typedef getreadbufferproc readbufferproc;
++typedef getwritebufferproc writebufferproc;
++typedef getsegcountproc segcountproc;
++typedef getcharbufferproc charbufferproc;
++static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
++{
++ long result = 0;
++ PyObject *i = PyNumber_Int(x);
++ if (i) {
++ result = PyInt_AsLong(i);
++ Py_DECREF(i);
++ }
++ return result;
++}
++#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 { \
++ if (op) { \
++ int vret = visit((op), arg); \
++ if (vret) \
++ return vret; \
++ } \
++ } while (0)
++#endif
++
++#if PY_VERSION_HEX < 0x02030000
++typedef struct {
++ PyTypeObject type;
++ PyNumberMethods as_number;
++ PyMappingMethods as_mapping;
++ PySequenceMethods as_sequence;
++ PyBufferProcs as_buffer;
++ PyObject *name, *slots;
++} PyHeapTypeObject;
++#endif
++
++#if PY_VERSION_HEX < 0x02030000
++typedef destructor freefunc;
++#endif
++
++#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
++ (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
++ (PY_MAJOR_VERSION > 3))
++# define SWIGPY_USE_CAPSULE
++# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
++#endif
++
++#if PY_VERSION_HEX < 0x03020000
++#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
++#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
+ #endif
+
+ /* -----------------------------------------------------------------------------
+@@ -1043,9 +1112,6 @@
+
+ #ifdef __cplusplus
+ extern "C" {
+-#if 0
+-} /* cc-mode */
+-#endif
+ #endif
+
+ /* -----------------------------------------------------------------------------
+@@ -1071,27 +1137,24 @@
+ * Wrapper of PyInstanceMethod_New() used in Python 3
+ * It is exported to the generated module, used for -fastproxy
+ * ----------------------------------------------------------------------------- */
+-SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
+-{
+ #if PY_VERSION_HEX >= 0x03000000
++SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
++{
+ return PyInstanceMethod_New(func);
++}
+ #else
++SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
++{
+ return NULL;
+-#endif
+ }
++#endif
+
+ #ifdef __cplusplus
+-#if 0
+-{ /* cc-mode */
+-#endif
+ }
+ #endif
+
+
+ /* -----------------------------------------------------------------------------
+- * See the LICENSE file for information on copyright, usage and redistribution
+- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+- *
+ * pyrun.swg
+ *
+ * This file contains the runtime support for Python modules
+@@ -1106,7 +1169,15 @@
+ #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+-#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags)
++
++#ifdef SWIGPYTHON_BUILTIN
++#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
++#else
++#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
++#endif
++
++#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
++
+ #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
+ #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
+ #define swig_owntype int
+@@ -1121,7 +1192,7 @@
+
+ /* for C or C++ function pointers */
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
+-#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0)
++#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
+
+ /* for C++ member pointers, ie, member methods */
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+@@ -1130,7 +1201,7 @@
+
+ /* 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)
+
+@@ -1156,7 +1227,7 @@
+ 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;
+ }
+
+@@ -1164,12 +1235,41 @@
+
+ /* Set a constant value */
+
++#if defined(SWIGPYTHON_BUILTIN)
++
++SWIGINTERN void
++SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
++ PyObject *s = PyString_InternFromString(key);
++ PyList_Append(seq, s);
++ Py_DECREF(s);
++}
++
++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);
++}
++
++#else
++
+ SWIGINTERN void
+ SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
+- PyDict_SetItemString(d, (char*) name, obj);
++#if PY_VERSION_HEX < 0x02030000
++ PyDict_SetItemString(d, (char *)name, obj);
++#else
++ PyDict_SetItemString(d, name, obj);
++#endif
+ Py_DECREF(obj);
+ }
+
++#endif
++
+ /* Append a value to the result obj */
+
+ SWIGINTERN PyObject*
+@@ -1230,6 +1330,14 @@
+ }
+ }
+ if (!PyTuple_Check(args)) {
++ if (min <= 1 && max >= 1) {
++ register int i;
++ objs[0] = args;
++ for (i = 1; i < max; ++i) {
++ objs[i] = 0;
++ }
++ return 2;
++ }
+ PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
+ return 0;
+ } else {
+@@ -1282,11 +1390,11 @@
+
+ #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
+
++#define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
++#define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
++
+ #ifdef __cplusplus
+ extern "C" {
+-#if 0
+-} /* cc-mode */
+-#endif
+ #endif
+
+ /* How to access Py_None */
+@@ -1337,6 +1445,7 @@
+ PyObject *destroy;
+ int delargs;
+ int implicitconv;
++ PyTypeObject *pytype;
+ } SwigPyClientData;
+
+ SWIGRUNTIMEINLINE int
+@@ -1403,13 +1512,13 @@
+ data->delargs = 0;
+ }
+ data->implicitconv = 0;
++ data->pytype = 0;
+ return data;
+ }
+ }
+
+ SWIGRUNTIME void
+-SwigPyClientData_Del(SwigPyClientData* data)
+-{
++SwigPyClientData_Del(SwigPyClientData *data) {
+ Py_XDECREF(data->newraw);
+ Py_XDECREF(data->newargs);
+ Py_XDECREF(data->destroy);
+@@ -1423,6 +1532,9 @@
+ swig_type_info *ty;
+ int own;
+ PyObject *next;
++#ifdef SWIGPYTHON_BUILTIN
++ PyObject *dict;
++#endif
+ } SwigPyObject;
+
+ SWIGRUNTIME PyObject *
+@@ -1473,21 +1585,21 @@
+ #endif
+ {
+ const char *name = SWIG_TypePrettyName(v->ty);
+- PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
++ PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
+ if (v->next) {
+-#ifdef METH_NOARGS
++# ifdef METH_NOARGS
+ PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
+-#else
++# else
+ PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
+-#endif
+-#if PY_VERSION_HEX >= 0x03000000
++# endif
++# if PY_VERSION_HEX >= 0x03000000
+ PyObject *joined = PyUnicode_Concat(repr, nrep);
+ Py_DecRef(repr);
+ Py_DecRef(nrep);
+ repr = joined;
+-#else
++# else
+ PyString_ConcatAndDel(&repr,nrep);
+-#endif
++# endif
+ }
+ return repr;
+ }
+@@ -1537,27 +1649,43 @@
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+- if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
+- res = Py_True;
+- else
+- res = Py_False;
+- Py_INCREF(res);
++ res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
+ return res;
+ }
+
+
+-SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
++SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
+
++#ifdef SWIGPYTHON_BUILTIN
++static swig_type_info *SwigPyObject_stype = 0;
+ SWIGRUNTIME PyTypeObject*
+ SwigPyObject_type(void) {
+- static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
++ SwigPyClientData *cd;
++ assert(SwigPyObject_stype);
++ cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
++ assert(cd);
++ assert(cd->pytype);
++ return cd->pytype;
++}
++#else
++SWIGRUNTIME PyTypeObject*
++SwigPyObject_type(void) {
++ static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
+ return type;
+ }
++#endif
+
+ SWIGRUNTIMEINLINE int
+ SwigPyObject_Check(PyObject *op) {
++#ifdef SWIGPYTHON_BUILTIN
++ PyTypeObject *target_tp = SwigPyObject_type();
++ if (PyType_IsSubtype(op->ob_type, target_tp))
++ return 1;
++ return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
++#else
+ return (Py_TYPE(op) == SwigPyObject_type())
+ || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
++#endif
+ }
+
+ SWIGRUNTIME PyObject *
+@@ -1661,8 +1789,10 @@
+ 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;
+@@ -1723,9 +1853,9 @@
+ #endif
+
+ SWIGRUNTIME PyTypeObject*
+-_PySwigObject_type(void) {
++SwigPyObject_TypeOnce(void) {
+ static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
+-
++
+ static PyNumberMethods SwigPyObject_as_number = {
+ (binaryfunc)0, /*nb_add*/
+ (binaryfunc)0, /*nb_subtract*/
+@@ -1772,85 +1902,89 @@
+ #endif
+ };
+
+- static PyTypeObject swigpyobject_type;
++ static PyTypeObject swigpyobject_type;
+ static int type_init = 0;
+ if (!type_init) {
+- const PyTypeObject tmp
+- = {
+- /* PyObject header changed in Python 3 */
++ const PyTypeObject tmp = {
++ /* PyObject header changed in Python 3 */
+ #if PY_VERSION_HEX >= 0x03000000
+- PyVarObject_HEAD_INIT(&PyType_Type, 0)
+-#else
+- PyObject_HEAD_INIT(NULL)
+- 0, /* ob_size */
+-#endif
+- (char *)"SwigPyObject", /* tp_name */
+- sizeof(SwigPyObject), /* tp_basicsize */
+- 0, /* tp_itemsize */
+- (destructor)SwigPyObject_dealloc, /* tp_dealloc */
+- (printfunc)SwigPyObject_print, /* tp_print */
++ PyVarObject_HEAD_INIT(NULL, 0)
++#else
++ PyObject_HEAD_INIT(NULL)
++ 0, /* ob_size */
++#endif
++ (char *)"SwigPyObject", /* tp_name */
++ sizeof(SwigPyObject), /* tp_basicsize */
++ 0, /* tp_itemsize */
++ (destructor)SwigPyObject_dealloc, /* tp_dealloc */
++ (printfunc)SwigPyObject_print, /* tp_print */
+ #if PY_VERSION_HEX < 0x02020000
+- (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
++ (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
+ #else
+- (getattrfunc)0, /* tp_getattr */
++ (getattrfunc)0, /* tp_getattr */
+ #endif
+- (setattrfunc)0, /* tp_setattr */
++ (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 */
+ #else
+- (cmpfunc)SwigPyObject_compare, /* tp_compare */
++ (cmpfunc)SwigPyObject_compare, /* tp_compare */
+ #endif
+- (reprfunc)SwigPyObject_repr, /* tp_repr */
+- &SwigPyObject_as_number, /* tp_as_number */
+- 0, /* tp_as_sequence */
+- 0, /* tp_as_mapping */
+- (hashfunc)0, /* tp_hash */
+- (ternaryfunc)0, /* tp_call */
+- (reprfunc)SwigPyObject_str, /* tp_str */
+- PyObject_GenericGetAttr, /* tp_getattro */
+- 0, /* tp_setattro */
+- 0, /* tp_as_buffer */
+- Py_TPFLAGS_DEFAULT, /* tp_flags */
+- swigobject_doc, /* tp_doc */
+- 0, /* tp_traverse */
+- 0, /* tp_clear */
+- (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */
+- 0, /* tp_weaklistoffset */
++ (reprfunc)SwigPyObject_repr, /* tp_repr */
++ &SwigPyObject_as_number, /* tp_as_number */
++ 0, /* tp_as_sequence */
++ 0, /* tp_as_mapping */
++ (hashfunc)0, /* tp_hash */
++ (ternaryfunc)0, /* tp_call */
++ (reprfunc)SwigPyObject_str, /* tp_str */
++ PyObject_GenericGetAttr, /* tp_getattro */
++ 0, /* tp_setattro */
++ 0, /* tp_as_buffer */
++ Py_TPFLAGS_DEFAULT, /* tp_flags */
++ swigobject_doc, /* tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
++ 0, /* tp_weaklistoffset */
+ #if PY_VERSION_HEX >= 0x02020000
+- 0, /* tp_iter */
+- 0, /* tp_iternext */
+- swigobject_methods, /* tp_methods */
+- 0, /* tp_members */
+- 0, /* tp_getset */
+- 0, /* tp_base */
+- 0, /* tp_dict */
+- 0, /* tp_descr_get */
+- 0, /* tp_descr_set */
+- 0, /* tp_dictoffset */
+- 0, /* tp_init */
+- 0, /* tp_alloc */
+- 0, /* tp_new */
+- 0, /* tp_free */
+- 0, /* tp_is_gc */
+- 0, /* tp_bases */
+- 0, /* tp_mro */
+- 0, /* tp_cache */
+- 0, /* tp_subclasses */
+- 0, /* tp_weaklist */
++ 0, /* tp_iter */
++ 0, /* tp_iternext */
++ swigobject_methods, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ 0, /* tp_init */
++ 0, /* tp_alloc */
++ 0, /* tp_new */
++ 0, /* tp_free */
++ 0, /* tp_is_gc */
++ 0, /* tp_bases */
++ 0, /* tp_mro */
++ 0, /* tp_cache */
++ 0, /* tp_subclasses */
++ 0, /* tp_weaklist */
+ #endif
+ #if PY_VERSION_HEX >= 0x02030000
+- 0, /* tp_del */
++ 0, /* tp_del */
++#endif
++#if PY_VERSION_HEX >= 0x02060000
++ 0, /* tp_version */
+ #endif
+ #ifdef COUNT_ALLOCS
+- 0,0,0,0 /* tp_alloc -> tp_next */
++ 0,0,0,0 /* tp_alloc -> tp_next */
+ #endif
+- };
++ };
+ swigpyobject_type = tmp;
+- /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+-#if PY_VERSION_HEX < 0x03000000
++ type_init = 1;
++#if PY_VERSION_HEX < 0x02020000
+ swigpyobject_type.ob_type = &PyType_Type;
++#else
++ if (PyType_Ready(&swigpyobject_type) < 0)
++ return NULL;
+ #endif
+- type_init = 1;
+ }
+ return &swigpyobject_type;
+ }
+@@ -1924,17 +2058,17 @@
+ return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
+ }
+
+-SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
++SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
+
+ SWIGRUNTIME PyTypeObject*
+ SwigPyPacked_type(void) {
+- static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
++ static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
+ return type;
+ }
+
+ SWIGRUNTIMEINLINE int
+ SwigPyPacked_Check(PyObject *op) {
+- return ((op)->ob_type == _PySwigPacked_type())
++ return ((op)->ob_type == SwigPyPacked_TypeOnce())
+ || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
+ }
+
+@@ -1949,83 +2083,87 @@
+ }
+
+ SWIGRUNTIME PyTypeObject*
+-_PySwigPacked_type(void) {
++SwigPyPacked_TypeOnce(void) {
+ static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
+ static PyTypeObject swigpypacked_type;
+- static int type_init = 0;
++ static int type_init = 0;
+ if (!type_init) {
+- const PyTypeObject tmp
+- = {
+- /* PyObject header changed in Python 3 */
++ const PyTypeObject tmp = {
++ /* PyObject header changed in Python 3 */
+ #if PY_VERSION_HEX>=0x03000000
+- PyVarObject_HEAD_INIT(&PyType_Type, 0)
++ PyVarObject_HEAD_INIT(NULL, 0)
+ #else
+- PyObject_HEAD_INIT(NULL)
+- 0, /* ob_size */
++ PyObject_HEAD_INIT(NULL)
++ 0, /* ob_size */
+ #endif
+- (char *)"SwigPyPacked", /* tp_name */
+- sizeof(SwigPyPacked), /* tp_basicsize */
+- 0, /* tp_itemsize */
+- (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
+- (printfunc)SwigPyPacked_print, /* tp_print */
+- (getattrfunc)0, /* tp_getattr */
+- (setattrfunc)0, /* tp_setattr */
++ (char *)"SwigPyPacked", /* tp_name */
++ sizeof(SwigPyPacked), /* tp_basicsize */
++ 0, /* tp_itemsize */
++ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
++ (printfunc)SwigPyPacked_print, /* tp_print */
++ (getattrfunc)0, /* tp_getattr */
++ (setattrfunc)0, /* tp_setattr */
+ #if PY_VERSION_HEX>=0x03000000
+- 0, /* tp_reserved in 3.0.1 */
++ 0, /* tp_reserved in 3.0.1 */
+ #else
+- (cmpfunc)SwigPyPacked_compare, /* tp_compare */
++ (cmpfunc)SwigPyPacked_compare, /* tp_compare */
+ #endif
+- (reprfunc)SwigPyPacked_repr, /* tp_repr */
+- 0, /* tp_as_number */
+- 0, /* tp_as_sequence */
+- 0, /* tp_as_mapping */
+- (hashfunc)0, /* tp_hash */
+- (ternaryfunc)0, /* tp_call */
+- (reprfunc)SwigPyPacked_str, /* tp_str */
+- PyObject_GenericGetAttr, /* tp_getattro */
+- 0, /* tp_setattro */
+- 0, /* tp_as_buffer */
+- Py_TPFLAGS_DEFAULT, /* tp_flags */
+- swigpacked_doc, /* tp_doc */
+- 0, /* tp_traverse */
+- 0, /* tp_clear */
+- 0, /* tp_richcompare */
+- 0, /* tp_weaklistoffset */
++ (reprfunc)SwigPyPacked_repr, /* tp_repr */
++ 0, /* tp_as_number */
++ 0, /* tp_as_sequence */
++ 0, /* tp_as_mapping */
++ (hashfunc)0, /* tp_hash */
++ (ternaryfunc)0, /* tp_call */
++ (reprfunc)SwigPyPacked_str, /* tp_str */
++ PyObject_GenericGetAttr, /* tp_getattro */
++ 0, /* tp_setattro */
++ 0, /* tp_as_buffer */
++ Py_TPFLAGS_DEFAULT, /* tp_flags */
++ swigpacked_doc, /* tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ 0, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
+ #if PY_VERSION_HEX >= 0x02020000
+- 0, /* tp_iter */
+- 0, /* tp_iternext */
+- 0, /* tp_methods */
+- 0, /* tp_members */
+- 0, /* tp_getset */
+- 0, /* tp_base */
+- 0, /* tp_dict */
+- 0, /* tp_descr_get */
+- 0, /* tp_descr_set */
+- 0, /* tp_dictoffset */
+- 0, /* tp_init */
+- 0, /* tp_alloc */
+- 0, /* tp_new */
+- 0, /* tp_free */
+- 0, /* tp_is_gc */
+- 0, /* tp_bases */
+- 0, /* tp_mro */
+- 0, /* tp_cache */
+- 0, /* tp_subclasses */
+- 0, /* tp_weaklist */
++ 0, /* tp_iter */
++ 0, /* tp_iternext */
++ 0, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ 0, /* tp_init */
++ 0, /* tp_alloc */
++ 0, /* tp_new */
++ 0, /* tp_free */
++ 0, /* tp_is_gc */
++ 0, /* tp_bases */
++ 0, /* tp_mro */
++ 0, /* tp_cache */
++ 0, /* tp_subclasses */
++ 0, /* tp_weaklist */
+ #endif
+ #if PY_VERSION_HEX >= 0x02030000
+- 0, /* tp_del */
++ 0, /* tp_del */
++#endif
++#if PY_VERSION_HEX >= 0x02060000
++ 0, /* tp_version */
+ #endif
+ #ifdef COUNT_ALLOCS
+- 0,0,0,0 /* tp_alloc -> tp_next */
++ 0,0,0,0 /* tp_alloc -> tp_next */
+ #endif
+- };
++ };
+ swigpypacked_type = tmp;
+- /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
+-#if PY_VERSION_HEX < 0x03000000
++ type_init = 1;
++#if PY_VERSION_HEX < 0x02020000
+ swigpypacked_type.ob_type = &PyType_Type;
++#else
++ if (PyType_Ready(&swigpypacked_type) < 0)
++ return NULL;
+ #endif
+- type_init = 1;
+ }
+ return &swigpypacked_type;
+ }
+@@ -2072,10 +2210,13 @@
+ return SWIG_Python_str_FromChar("this");
+ }
+
++static PyObject *swig_this = NULL;
++
+ SWIGRUNTIME PyObject *
+ SWIG_This(void)
+ {
+- static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
++ if (swig_this == NULL)
++ swig_this = _SWIG_This();
+ return swig_this;
+ }
+
+@@ -2089,50 +2230,65 @@
+ SWIGRUNTIME SwigPyObject *
+ SWIG_Python_GetSwigThis(PyObject *pyobj)
+ {
+- if (SwigPyObject_Check(pyobj)) {
++ PyObject *obj;
++
++ if (SwigPyObject_Check(pyobj))
+ return (SwigPyObject *) pyobj;
+- } else {
+- PyObject *obj = 0;
++
++#ifdef SWIGPYTHON_BUILTIN
++ (void)obj;
++# ifdef PyWeakref_CheckProxy
++ if (PyWeakref_CheckProxy(pyobj)) {
++ pyobj = PyWeakref_GET_OBJECT(pyobj);
++ if (pyobj && SwigPyObject_Check(pyobj))
++ return (SwigPyObject*) pyobj;
++ }
++# endif
++ return NULL;
++#else
++
++ obj = 0;
++
+ #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
+- if (PyInstance_Check(pyobj)) {
+- obj = _PyInstance_Lookup(pyobj, SWIG_This());
++ if (PyInstance_Check(pyobj)) {
++ obj = _PyInstance_Lookup(pyobj, SWIG_This());
++ } else {
++ PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
++ if (dictptr != NULL) {
++ PyObject *dict = *dictptr;
++ obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+ } else {
+- PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+- if (dictptr != NULL) {
+- PyObject *dict = *dictptr;
+- obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+- } else {
+ #ifdef PyWeakref_CheckProxy
+- if (PyWeakref_CheckProxy(pyobj)) {
+- PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+- return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+- }
++ if (PyWeakref_CheckProxy(pyobj)) {
++ PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
++ return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
++ }
+ #endif
+- obj = PyObject_GetAttr(pyobj,SWIG_This());
+- if (obj) {
+- Py_DECREF(obj);
+- } else {
+- if (PyErr_Occurred()) PyErr_Clear();
+- return 0;
+- }
++ obj = PyObject_GetAttr(pyobj,SWIG_This());
++ if (obj) {
++ Py_DECREF(obj);
++ } else {
++ if (PyErr_Occurred()) PyErr_Clear();
++ return 0;
+ }
+ }
++ }
+ #else
+- obj = PyObject_GetAttr(pyobj,SWIG_This());
+- if (obj) {
+- Py_DECREF(obj);
+- } else {
+- if (PyErr_Occurred()) PyErr_Clear();
+- return 0;
+- }
++ obj = PyObject_GetAttr(pyobj,SWIG_This());
++ if (obj) {
++ Py_DECREF(obj);
++ } else {
++ if (PyErr_Occurred()) PyErr_Clear();
++ return 0;
++ }
+ #endif
+- if (obj && !SwigPyObject_Check(obj)) {
+- /* a PyObject is called 'this', try to get the 'real this'
+- SwigPyObject from it */
+- return SWIG_Python_GetSwigThis(obj);
+- }
+- return (SwigPyObject *)obj;
++ if (obj && !SwigPyObject_Check(obj)) {
++ /* a PyObject is called 'this', try to get the 'real this'
++ SwigPyObject from it */
++ return SWIG_Python_GetSwigThis(obj);
+ }
++ return (SwigPyObject *)obj;
++#endif
+ }
+
+ /* Acquire a pointer value */
+@@ -2154,91 +2310,97 @@
+
+ SWIGRUNTIME int
+ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
+- if (!obj) return SWIG_ERROR;
++ int res;
++ SwigPyObject *sobj;
++
++ if (!obj)
++ return SWIG_ERROR;
+ if (obj == Py_None) {
+- if (ptr) *ptr = 0;
++ if (ptr)
++ *ptr = 0;
+ return SWIG_OK;
+- } else {
+- SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
+- if (own)
+- *own = 0;
+- while (sobj) {
+- void *vptr = sobj->ptr;
+- if (ty) {
+- swig_type_info *to = sobj->ty;
+- if (to == ty) {
+- /* no type cast needed */
+- if (ptr) *ptr = vptr;
+- break;
+- } else {
+- swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+- if (!tc) {
+- sobj = (SwigPyObject *)sobj->next;
+- } else {
+- if (ptr) {
+- int newmemory = 0;
+- *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+- if (newmemory == SWIG_CAST_NEW_MEMORY) {
+- assert(own);
+- if (own)
+- *own = *own | SWIG_CAST_NEW_MEMORY;
+- }
+- }
+- break;
+- }
+- }
++ }
++
++ res = SWIG_ERROR;
++
++ sobj = SWIG_Python_GetSwigThis(obj);
++ if (own)
++ *own = 0;
++ while (sobj) {
++ void *vptr = sobj->ptr;
++ if (ty) {
++ swig_type_info *to = sobj->ty;
++ if (to == ty) {
++ /* no type cast needed */
++ if (ptr) *ptr = vptr;
++ break;
+ } else {
+- if (ptr) *ptr = vptr;
+- break;
+- }
+- }
+- if (sobj) {
+- if (own)
+- *own = *own | sobj->own;
+- if (flags & SWIG_POINTER_DISOWN) {
+- sobj->own = 0;
++ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
++ if (!tc) {
++ sobj = (SwigPyObject *)sobj->next;
++ } else {
++ if (ptr) {
++ int newmemory = 0;
++ *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
++ if (newmemory == SWIG_CAST_NEW_MEMORY) {
++ assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
++ if (own)
++ *own = *own | SWIG_CAST_NEW_MEMORY;
++ }
++ }
++ break;
++ }
+ }
+- return SWIG_OK;
+ } else {
+- int res = SWIG_ERROR;
+- if (flags & SWIG_POINTER_IMPLICIT_CONV) {
+- SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+- if (data && !data->implicitconv) {
+- PyObject *klass = data->klass;
+- if (klass) {
+- PyObject *impconv;
+- data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+- impconv = SWIG_Python_CallFunctor(klass, obj);
+- data->implicitconv = 0;
+- if (PyErr_Occurred()) {
+- PyErr_Clear();
+- impconv = 0;
+- }
+- if (impconv) {
+- SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
+- if (iobj) {
+- void *vptr;
+- res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+- if (SWIG_IsOK(res)) {
+- if (ptr) {
+- *ptr = vptr;
+- /* transfer the ownership to 'ptr' */
+- iobj->own = 0;
+- res = SWIG_AddCast(res);
+- res = SWIG_AddNewMask(res);
+- } else {
+- res = SWIG_AddCast(res);
+- }
+- }
+- }
+- Py_DECREF(impconv);
+- }
+- }
+- }
++ if (ptr) *ptr = vptr;
++ break;
++ }
++ }
++ if (sobj) {
++ if (own)
++ *own = *own | sobj->own;
++ if (flags & SWIG_POINTER_DISOWN) {
++ sobj->own = 0;
++ }
++ res = SWIG_OK;
++ } else {
++ if (flags & SWIG_POINTER_IMPLICIT_CONV) {
++ SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
++ if (data && !data->implicitconv) {
++ PyObject *klass = data->klass;
++ if (klass) {
++ PyObject *impconv;
++ data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
++ impconv = SWIG_Python_CallFunctor(klass, obj);
++ data->implicitconv = 0;
++ if (PyErr_Occurred()) {
++ PyErr_Clear();
++ impconv = 0;
++ }
++ if (impconv) {
++ SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
++ if (iobj) {
++ void *vptr;
++ res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
++ if (SWIG_IsOK(res)) {
++ if (ptr) {
++ *ptr = vptr;
++ /* transfer the ownership to 'ptr' */
++ iobj->own = 0;
++ res = SWIG_AddCast(res);
++ res = SWIG_AddNewMask(res);
++ } else {
++ res = SWIG_AddCast(res);
++ }
++ }
++ }
++ Py_DECREF(impconv);
++ }
++ }
+ }
+- return res;
+ }
+ }
++ return res;
+ }
+
+ /* Convert a function ptr value */
+@@ -2325,23 +2487,29 @@
+ } 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;
++ 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);
+@@ -2392,7 +2560,7 @@
+ 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]);
+@@ -2408,22 +2576,52 @@
+ /* Create a new pointer object */
+
+ SWIGRUNTIME PyObject *
+-SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
+- if (!ptr) {
++SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
++ SwigPyClientData *clientdata;
++ PyObject * robj;
++ int own;
++
++ if (!ptr)
+ return SWIG_Py_Void();
+- } else {
+- int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+- PyObject *robj = SwigPyObject_New(ptr, type, own);
+- SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
+- if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+- PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+- if (inst) {
+- Py_DECREF(robj);
+- robj = inst;
++
++ clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
++ own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
++ if (clientdata && clientdata->pytype) {
++ SwigPyObject *newobj;
++ if (flags & SWIG_BUILTIN_TP_INIT) {
++ newobj = (SwigPyObject*) self;
++ if (newobj->ptr) {
++ PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
++ while (newobj->next)
++ newobj = (SwigPyObject *) newobj->next;
++ newobj->next = next_self;
++ newobj = (SwigPyObject *)next_self;
+ }
++ } else {
++ newobj = PyObject_New(SwigPyObject, clientdata->pytype);
+ }
+- return robj;
++ 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();
+ }
++
++ assert(!(flags & SWIG_BUILTIN_TP_INIT));
++
++ robj = SwigPyObject_New(ptr, type, own);
++ if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
++ PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
++ Py_DECREF(robj);
++ robj = inst;
++ }
++ return robj;
+ }
+
+ /* Create a new packed object */
+@@ -2442,15 +2640,19 @@
+ #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) {
+ #ifdef SWIG_LINK_RUNTIME
+ type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
+ #else
++# ifdef SWIGPY_USE_CAPSULE
++ type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
++# else
+ type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+ (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
++# endif
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ type_pointer = (void *)0;
+@@ -2493,9 +2695,17 @@
+ #endif
+
+ SWIGRUNTIME void
++#ifdef SWIGPY_USE_CAPSULE
++SWIG_Python_DestroyModule(PyObject *obj)
++#else
+ SWIG_Python_DestroyModule(void *vptr)
++#endif
+ {
++#ifdef SWIGPY_USE_CAPSULE
++ swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
++#else
+ swig_module_info *swig_module = (swig_module_info *) vptr;
++#endif
+ swig_type_info **types = swig_module->types;
+ size_t i;
+ for (i =0; i < swig_module->size; ++i) {
+@@ -2506,25 +2716,33 @@
+ }
+ }
+ Py_DECREF(SWIG_This());
++ swig_this = NULL;
+ }
+
+ SWIGRUNTIME void
+ SWIG_Python_SetModule(swig_module_info *swig_module) {
+- static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
+-
+ #if PY_VERSION_HEX >= 0x03000000
+ /* Add a dummy module object into sys.modules */
+ PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
+ #else
+- PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+- swig_empty_runtime_method_table);
++ static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
++ PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
+ #endif
++#ifdef SWIGPY_USE_CAPSULE
++ PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
++ if (pointer && module) {
++ PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
++ } else {
++ Py_XDECREF(pointer);
++ }
++#else
+ PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+ if (pointer && module) {
+ PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+ } else {
+ Py_XDECREF(pointer);
+ }
++#endif
+ }
+
+ /* The python cached type query */
+@@ -2542,12 +2760,20 @@
+ PyObject *obj = PyDict_GetItem(cache, key);
+ swig_type_info *descriptor;
+ if (obj) {
++#ifdef SWIGPY_USE_CAPSULE
++ descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
++#else
+ 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
++ obj = PyCapsule_New((void*) descriptor, NULL, NULL);
++#else
+ obj = PyCObject_FromVoidPtr(descriptor, NULL);
++#endif
+ PyDict_SetItem(cache, key, obj);
+ Py_DECREF(obj);
+ }
+@@ -2608,7 +2834,7 @@
+ {
+ SwigPyObject *v = (SwigPyObject *)self;
+ swig_type_info *ty = v ? v->ty : 0;
+- return ty ? ty->str : (char*)"";
++ return ty ? ty->str : "";
+ }
+
+ SWIGRUNTIME void
+@@ -2651,7 +2877,7 @@
+
+ /* Convert a pointer value, signal an exception on a type mismatch */
+ SWIGRUNTIME void *
+-SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
++SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
+ void *result;
+ if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
+ PyErr_Clear();
+@@ -2665,11 +2891,62 @@
+ 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;
+
+-#ifdef __cplusplus
+-#if 0
+-{ /* cc-mode */
++# 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
++ if (!PyString_Check(name))
++# endif
++ {
++ PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
++ return -1;
++ } else {
++ Py_INCREF(name);
++ }
++
++ if (!tp->tp_dict) {
++ if (PyType_Ready(tp) < 0)
++ goto done;
++ }
++
++ res = -1;
++ descr = _PyType_Lookup(tp, name);
++ f = NULL;
++ if (descr != NULL)
++ f = descr->ob_type->tp_descr_set;
++ if (!f) {
++ if (PyString_Check(name)) {
++ encoded_name = name;
++ Py_INCREF(name);
++ } else {
++ encoded_name = PyUnicode_AsUTF8String(name);
++ }
++ PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
++ Py_DECREF(encoded_name);
++ } else {
++ res = f(descr, obj, value);
++ }
++
++ done:
++ Py_DECREF(name);
++ return res;
++}
+ #endif
++
++
++#ifdef __cplusplus
+ }
+ #endif
+
+@@ -2720,7 +2997,7 @@
+ #endif
+ #define SWIG_name "_MeCab"
+
+-#define SWIGVERSION 0x010340
++#define SWIGVERSION 0x020009
+ #define SWIG_VERSION SWIGVERSION
+
+
+@@ -2876,7 +3153,7 @@
+ if (size > INT_MAX) {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ return pchar_descriptor ?
+- SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
++ 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));
+@@ -2897,28 +3174,28 @@
+ }
+
+
+- #define SWIG_From_long PyInt_FromLong
++SWIGINTERNINLINE PyObject*
++ SWIG_From_unsigned_SS_int (unsigned int value)
++{
++ return PyInt_FromSize_t((size_t) value);
++}
+
+
+-SWIGINTERNINLINE PyObject*
+-SWIG_From_unsigned_SS_long (unsigned long value)
++SWIGINTERNINLINE PyObject*
++ SWIG_From_int (int value)
+ {
+- return (value > LONG_MAX) ?
+- PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value));
++ return PyInt_FromLong((long) value);
+ }
+
+
+-SWIGINTERNINLINE PyObject *
+-SWIG_From_unsigned_SS_int (unsigned int value)
+-{
+- return SWIG_From_unsigned_SS_long (value);
+-}
++ #define SWIG_From_long PyLong_FromLong
+
+
+-SWIGINTERNINLINE PyObject *
+-SWIG_From_int (int value)
+-{
+- return SWIG_From_long (value);
++SWIGINTERNINLINE PyObject*
++SWIG_From_unsigned_SS_long (unsigned long value)
++{
++ return (value > LONG_MAX) ?
++ PyLong_FromUnsignedLong(value) : PyLong_FromLong(static_cast< long >(value));
+ }
+
+
+@@ -3059,6 +3336,7 @@
+ 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) {
+@@ -3067,7 +3345,9 @@
+ } 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;
+@@ -4940,8 +5220,8 @@
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+- argc = (int)PyObject_Length(args);
+- for (ii = 0; (ii < argc) && (ii < 2); ii++) {
++ 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) {
+@@ -4969,11 +5249,11 @@
+ }
+
+ fail:
+- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Lattice_toString'.\n"
++ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Lattice_toString'.\n"
+ " Possible C/C++ prototypes are:\n"
+- " toString(MeCab::Lattice *)\n"
+- " toString(MeCab::Lattice *,MeCab::Node const *)\n");
+- return NULL;
++ " MeCab::Lattice::toString()\n"
++ " MeCab::Lattice::toString(MeCab::Node const *)\n");
++ return 0;
+ }
+
+
+@@ -5470,8 +5750,8 @@
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+- argc = (int)PyObject_Length(args);
+- for (ii = 0; (ii < argc) && (ii < 2); ii++) {
++ 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) {
+@@ -5499,11 +5779,11 @@
+ }
+
+ fail:
+- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Model_create'.\n"
++ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Model_create'.\n"
+ " Possible C/C++ prototypes are:\n"
+- " create(int,char **)\n"
++ " MeCab::Model::create(int,char **)\n"
+ " MeCab::Model::create(char const *)\n");
+- return NULL;
++ return 0;
+ }
+
+
+@@ -5571,8 +5851,8 @@
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+- argc = (int)PyObject_Length(args);
+- for (ii = 0; (ii < argc) && (ii < 1); ii++) {
++ argc = args ? (int)PyObject_Length(args) : 0;
++ for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+@@ -5588,11 +5868,11 @@
+ }
+
+ fail:
+- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Model'.\n"
++ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Model'.\n"
+ " Possible C/C++ prototypes are:\n"
+- " MeCab::Model(char const *)\n"
+- " MeCab::Model()\n");
+- return NULL;
++ " MeCab::Model::Model(char const *)\n"
++ " MeCab::Model::Model()\n");
++ return 0;
+ }
+
+
+@@ -5738,8 +6018,8 @@
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+- argc = (int)PyObject_Length(args);
+- for (ii = 0; (ii < argc) && (ii < 2); ii++) {
++ argc = args ? (int)PyObject_Length(args) : 0;
++ for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+@@ -5784,12 +6064,12 @@
+ }
+
+ fail:
+- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Tagger_parse'.\n"
++ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Tagger_parse'.\n"
+ " Possible C/C++ prototypes are:\n"
+- " parse(MeCab::Model const &,MeCab::Lattice *)\n"
+- " parse(MeCab::Tagger const *,MeCab::Lattice *)\n"
+- " parse(MeCab::Tagger *,char const *)\n");
+- return NULL;
++ " MeCab::Tagger::parse(MeCab::Model const &,MeCab::Lattice *)\n"
++ " MeCab::Tagger::parse(MeCab::Lattice *) const\n"
++ " MeCab::Tagger::parse(char const *)\n");
++ return 0;
+ }
+
+
+@@ -6576,8 +6856,8 @@
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+- argc = (int)PyObject_Length(args);
+- for (ii = 0; (ii < argc) && (ii < 2); ii++) {
++ 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) {
+@@ -6605,11 +6885,11 @@
+ }
+
+ fail:
+- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Tagger_create'.\n"
++ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Tagger_create'.\n"
+ " Possible C/C++ prototypes are:\n"
+- " create(int,char **)\n"
++ " MeCab::Tagger::create(int,char **)\n"
+ " MeCab::Tagger::create(char const *)\n");
+- return NULL;
++ return 0;
+ }
+
+
+@@ -6700,8 +6980,8 @@
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+- argc = (int)PyObject_Length(args);
+- for (ii = 0; (ii < argc) && (ii < 1); ii++) {
++ argc = args ? (int)PyObject_Length(args) : 0;
++ for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+@@ -6717,11 +6997,11 @@
+ }
+
+ fail:
+- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Tagger'.\n"
++ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Tagger'.\n"
+ " Possible C/C++ prototypes are:\n"
+- " MeCab::Tagger(char const *)\n"
+- " MeCab::Tagger()\n");
+- return NULL;
++ " MeCab::Tagger::Tagger(char const *)\n"
++ " MeCab::Tagger::Tagger()\n");
++ return 0;
+ }
+
+
+@@ -6828,8 +7108,8 @@
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+- argc = (int)PyObject_Length(args);
+- for (ii = 0; (ii < argc) && (ii < 3); ii++) {
++ argc = args ? (int)PyObject_Length(args) : 0;
++ for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+@@ -6866,11 +7146,11 @@
+ }
+
+ fail:
+- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Tagger_parseToString'.\n"
++ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Tagger_parseToString'.\n"
+ " Possible C/C++ prototypes are:\n"
+- " parseToString(MeCab::Tagger *,char const *,size_t)\n"
+- " parseToString(MeCab::Tagger *,char const *)\n");
+- return NULL;
++ " MeCab::Tagger::parseToString(char const *,size_t)\n"
++ " MeCab::Tagger::parseToString(char const *)\n");
++ return 0;
+ }
+
+
+@@ -7104,8 +7384,6 @@
+ swig_module_info *module_head, *iter;
+ int found, init;
+
+- clientdata = clientdata;
+-
+ /* check to see if the circular list has been setup, if not, set it up */
+ if (swig_module.next==0) {
+ /* Initialize the swig_module */
+@@ -7416,24 +7694,23 @@
+ swig_varlink_type(void) {
+ static char varlink__doc__[] = "Swig var link object";
+ static PyTypeObject varlink_type;
+- static int type_init = 0;
++ static int type_init = 0;
+ if (!type_init) {
+- const PyTypeObject tmp
+- = {
++ const PyTypeObject tmp = {
+ /* PyObject header changed in Python 3 */
+ #if PY_VERSION_HEX >= 0x03000000
+- PyVarObject_HEAD_INIT(&PyType_Type, 0)
++ PyVarObject_HEAD_INIT(NULL, 0)
+ #else
+ PyObject_HEAD_INIT(NULL)
+- 0, /* Number of items in variable part (ob_size) */
++ 0, /* ob_size */
+ #endif
+- (char *)"swigvarlink", /* Type name (tp_name) */
+- sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
+- 0, /* Itemsize (tp_itemsize) */
+- (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
+- (printfunc) swig_varlink_print, /* Print (tp_print) */
+- (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
+- (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
++ (char *)"swigvarlink", /* tp_name */
++ sizeof(swig_varlinkobject), /* tp_basicsize */
++ 0, /* tp_itemsize */
++ (destructor) swig_varlink_dealloc, /* tp_dealloc */
++ (printfunc) swig_varlink_print, /* tp_print */
++ (getattrfunc) swig_varlink_getattr, /* tp_getattr */
++ (setattrfunc) swig_varlink_setattr, /* tp_setattr */
+ 0, /* tp_compare */
+ (reprfunc) swig_varlink_repr, /* tp_repr */
+ 0, /* tp_as_number */
+@@ -7457,16 +7734,21 @@
+ #if PY_VERSION_HEX >= 0x02030000
+ 0, /* tp_del */
+ #endif
++#if PY_VERSION_HEX >= 0x02060000
++ 0, /* tp_version */
++#endif
+ #ifdef COUNT_ALLOCS
+ 0,0,0,0 /* tp_alloc -> tp_next */
+ #endif
+ };
+ varlink_type = tmp;
+- /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+-#if PY_VERSION_HEX < 0x03000000
++ type_init = 1;
++#if PY_VERSION_HEX < 0x02020000
+ varlink_type.ob_type = &PyType_Type;
++#else
++ if (PyType_Ready(&varlink_type) < 0)
++ return NULL;
+ #endif
+- type_init = 1;
+ }
+ return &varlink_type;
+ }
+@@ -7517,7 +7799,7 @@
+ for (i = 0; constants[i].type; ++i) {
+ switch(constants[i].type) {
+ case SWIG_PY_POINTER:
+- obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
++ obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+ break;
+ case SWIG_PY_BINARY:
+ obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+@@ -7557,15 +7839,15 @@
+ }
+ }
+ if (ci) {
+- size_t shift = (ci->ptype) - types;
+- swig_type_info *ty = types_initial[shift];
+- size_t ldoc = (c - methods[i].ml_doc);
+- size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+- char *ndoc = (char*)malloc(ldoc + lptr + 10);
+- if (ndoc) {
+- char *buff = ndoc;
+- void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+- if (ptr) {
++ void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
++ if (ptr) {
++ size_t shift = (ci->ptype) - types;
++ swig_type_info *ty = types_initial[shift];
++ size_t ldoc = (c - methods[i].ml_doc);
++ size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
++ char *ndoc = (char*)malloc(ldoc + lptr + 10);
++ if (ndoc) {
++ char *buff = ndoc;
+ strncpy(buff, methods[i].ml_doc, ldoc);
+ buff += ldoc;
+ strncpy(buff, "swig_ptr: ", 10);
+@@ -7598,10 +7880,19 @@
+ void
+ #endif
+ SWIG_init(void) {
+- PyObject *m, *d;
++ PyObject *m, *d, *md;
+ #if PY_VERSION_HEX >= 0x03000000
+ static struct PyModuleDef SWIG_module = {
++# if PY_VERSION_HEX >= 0x03020000
+ PyModuleDef_HEAD_INIT,
++# else
++ {
++ PyObject_HEAD_INIT(NULL)
++ NULL, /* m_init */
++ 0, /* m_index */
++ NULL, /* m_copy */
++ },
++# endif
+ (char *) SWIG_name,
+ NULL,
+ -1,
+@@ -7613,6 +7904,49 @@
+ };
+ #endif
+
++#if defined(SWIGPYTHON_BUILTIN)
++ static SwigPyClientData SwigPyObject_clientdata = {
++ 0, 0, 0, 0, 0, 0, 0
++ };
++ static PyGetSetDef this_getset_def = {
++ (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
++ };
++ static SwigPyGetSet thisown_getset_closure = {
++ (PyCFunction) SwigPyObject_own,
++ (PyCFunction) SwigPyObject_own
++ };
++ 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;
++ SwigPyClientData *cd;
++ PyObject *public_interface, *public_symbol;
++ PyObject *this_descr;
++ PyObject *thisown_descr;
++ int i;
++
++ (void)builtin_pytype;
++ (void)builtin_base_count;
++ (void)builtin_basetype;
++ (void)tuple;
++ (void)static_getset;
++
++ /* 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);
++ 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 */
+ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
+
+@@ -7621,11 +7955,48 @@
+ #else
+ m = Py_InitModule((char *) SWIG_name, SwigMethods);
+ #endif
+- d = PyModule_GetDict(m);
++ md = d = PyModule_GetDict(m);
++ (void)md;
+
+ SWIG_InitializeModule(0);
+- SWIG_InstallConstants(d,swig_const_table);
+
++#ifdef SWIGPYTHON_BUILTIN
++ 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) {
++ PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
++# if PY_VERSION_HEX >= 0x03000000
++ return NULL;
++# else
++ return;
++# endif
++ }
++
++ /* All objects have a 'this' attribute */
++ this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
++ (void)this_descr;
++
++ /* All objects have a 'thisown' attribute */
++ thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
++ (void)thisown_descr;
++
++ public_interface = PyList_New(0);
++ public_symbol = 0;
++ (void)public_symbol;
++
++ PyDict_SetItemString(md, "__all__", public_interface);
++ Py_DECREF(public_interface);
++ for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
++ SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
++ for (i = 0; swig_const_table[i].name != 0; ++i)
++ SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
++#endif
++
++ SWIG_InstallConstants(d,swig_const_table);
+
+ SWIG_Python_SetConstant(d, "MECAB_NOR_NODE",SWIG_From_int(static_cast< int >(MECAB_NOR_NODE)));
+ SWIG_Python_SetConstant(d, "MECAB_UNK_NODE",SWIG_From_int(static_cast< int >(MECAB_UNK_NODE)));
diff -Nru python-mecab-0.99.3/debian/patches/series python-mecab-0.99.3/debian/patches/series
--- python-mecab-0.99.3/debian/patches/series 1970-01-01 09:00:00.000000000 +0900
+++ python-mecab-0.99.3/debian/patches/series 2013-08-12 14:09:58.000000000 +0900
@@ -0,0 +1,2 @@
+0001-modernize-setup.py
+0002-update-swig-files.py
diff -Nru python-mecab-0.99.3/debian/pycompat python-mecab-0.99.3/debian/pycompat
--- python-mecab-0.99.3/debian/pycompat 2010-12-28 17:41:05.000000000 +0900
+++ python-mecab-0.99.3/debian/pycompat 1970-01-01 09:00:00.000000000 +0900
@@ -1 +0,0 @@
-2
diff -Nru python-mecab-0.99.3/debian/rules python-mecab-0.99.3/debian/rules
--- python-mecab-0.99.3/debian/rules 2011-05-23 11:11:39.000000000 +0900
+++ python-mecab-0.99.3/debian/rules 2013-08-12 15:26:58.000000000 +0900
@@ -1,4 +1,35 @@
#!/usr/bin/make -f
+# uncomment to enable verbose mode for debhelper
+#DH_VERBOSE = 1
+# uncomment to exclude VCS paths
+#DH_ALWAYS_EXCLUDE=CVS:.svn:.git
%:
- dh $@ --with python2
+ dh $@ --with python2,python3
+
+# special work around for python3 (#538978 and #597105 bugs)
+PY3REQUESTED := $(shell py3versions -r)
+PY3DEFAULT := $(shell py3versions -d)
+PYTHON3 := $(filter-out $(PY3DEFAULT),$(PY3REQUESTED)) python3
+
+override_dh_auto_clean:
+ -rm -rf build
+ -rm -rf dist
+ -rm -rf debian/python-mecab
+
+override_dh_auto_build:
+ dh_auto_build
+ set -ex; for python in $(PYTHON3); do \
+ $$python setup.py build; \
+ done
+
+override_dh_auto_install:
+ dh_auto_install
+ set -ex; for python in $(PYTHON3); do \
+ $$python setup.py install \
+ --root=debian/python-mecab\
+ --force\
+ --install-layout=deb; \
+ done
+ -rm -rf debian/python-mecab/usr/lib/python3/dist-packages/__pycache__
+
--- End Message ---