diff --git a/mecab/csharp/DictionaryInfo.cs b/mecab/csharp/DictionaryInfo.cs index ba1da3f..a52a52b 100644 --- a/mecab/csharp/DictionaryInfo.cs +++ b/mecab/csharp/DictionaryInfo.cs @@ -1,43 +1,46 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - -public class DictionaryInfo : IDisposable { - private HandleRef swigCPtr; +public class DictionaryInfo : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal DictionaryInfo(IntPtr cPtr, bool cMemoryOwn) { + internal DictionaryInfo(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; - swigCPtr = new HandleRef(this, cPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static HandleRef getCPtr(DictionaryInfo obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DictionaryInfo obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~DictionaryInfo() { - Dispose(); + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); } - public virtual void Dispose() { + protected virtual void Dispose(bool disposing) { lock(this) { - if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; MeCabPINVOKE.delete_DictionaryInfo(swigCPtr); } - swigCPtr = new HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - GC.SuppressFinalize(this); } } @@ -99,8 +102,8 @@ public ushort version { public DictionaryInfo next { get { - IntPtr cPtr = MeCabPINVOKE.DictionaryInfo_next_get(swigCPtr); - DictionaryInfo ret = (cPtr == IntPtr.Zero) ? null : new DictionaryInfo(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.DictionaryInfo_next_get(swigCPtr); + DictionaryInfo ret = (cPtr == global::System.IntPtr.Zero) ? null : new DictionaryInfo(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/mecab/csharp/Lattice.cs b/mecab/csharp/Lattice.cs index 5196f24..1ad6dc8 100644 --- a/mecab/csharp/Lattice.cs +++ b/mecab/csharp/Lattice.cs @@ -1,43 +1,46 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - -public class Lattice : IDisposable { - private HandleRef swigCPtr; +public class Lattice : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal Lattice(IntPtr cPtr, bool cMemoryOwn) { + internal Lattice(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; - swigCPtr = new HandleRef(this, cPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static HandleRef getCPtr(Lattice obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Lattice obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Lattice() { - Dispose(); + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); } - public virtual void Dispose() { + protected virtual void Dispose(bool disposing) { lock(this) { - if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; MeCabPINVOKE.delete_Lattice(swigCPtr); } - swigCPtr = new HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - GC.SuppressFinalize(this); } } @@ -53,29 +56,29 @@ public virtual bool is_available() { } public virtual Node bos_node() { - IntPtr cPtr = MeCabPINVOKE.Lattice_bos_node(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Lattice_bos_node(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } public virtual Node eos_node() { - IntPtr cPtr = MeCabPINVOKE.Lattice_eos_node(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Lattice_eos_node(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } public virtual Node end_nodes(uint pos) { - IntPtr cPtr = MeCabPINVOKE.Lattice_end_nodes(swigCPtr, pos); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Lattice_end_nodes(swigCPtr, pos); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } public virtual Node begin_nodes(uint pos) { - IntPtr cPtr = MeCabPINVOKE.Lattice_begin_nodes(swigCPtr, pos); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Lattice_begin_nodes(swigCPtr, pos); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -148,8 +151,8 @@ public virtual void remove_request_type(int request_type) { } public virtual Node newNode() { - IntPtr cPtr = MeCabPINVOKE.Lattice_newNode(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Lattice_newNode(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/mecab/csharp/MeCab.cs b/mecab/csharp/MeCab.cs index 143dc2f..28751b8 100644 --- a/mecab/csharp/MeCab.cs +++ b/mecab/csharp/MeCab.cs @@ -1,16 +1,15 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - public class MeCab { public static readonly int MECAB_NOR_NODE = MeCabPINVOKE.MECAB_NOR_NODE_get(); public static readonly int MECAB_UNK_NODE = MeCabPINVOKE.MECAB_UNK_NODE_get(); diff --git a/mecab/csharp/MeCabPINVOKE.cs b/mecab/csharp/MeCabPINVOKE.cs index c1fd47e..378a4a8 100644 --- a/mecab/csharp/MeCabPINVOKE.cs +++ b/mecab/csharp/MeCabPINVOKE.cs @@ -1,16 +1,15 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - class MeCabPINVOKE { protected class SWIGExceptionHelper { @@ -34,7 +33,7 @@ protected class SWIGExceptionHelper { static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException); static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException); - [DllImport("MeCab", EntryPoint="SWIGRegisterExceptionCallbacks_MeCab")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="SWIGRegisterExceptionCallbacks_MeCab")] public static extern void SWIGRegisterExceptionCallbacks_MeCab( ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, @@ -48,58 +47,58 @@ public static extern void SWIGRegisterExceptionCallbacks_MeCab( ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate); - [DllImport("MeCab", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_MeCab")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_MeCab")] public static extern void SWIGRegisterExceptionCallbacksArgument_MeCab( ExceptionArgumentDelegate argumentDelegate, ExceptionArgumentDelegate argumentNullDelegate, ExceptionArgumentDelegate argumentOutOfRangeDelegate); static void SetPendingApplicationException(string message) { - SWIGPendingException.Set(new System.ApplicationException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve())); } static void SetPendingArithmeticException(string message) { - SWIGPendingException.Set(new System.ArithmeticException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve())); } static void SetPendingDivideByZeroException(string message) { - SWIGPendingException.Set(new System.DivideByZeroException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve())); } static void SetPendingIndexOutOfRangeException(string message) { - SWIGPendingException.Set(new System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); } static void SetPendingInvalidCastException(string message) { - SWIGPendingException.Set(new System.InvalidCastException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve())); } static void SetPendingInvalidOperationException(string message) { - SWIGPendingException.Set(new System.InvalidOperationException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve())); } static void SetPendingIOException(string message) { - SWIGPendingException.Set(new System.IO.IOException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve())); } static void SetPendingNullReferenceException(string message) { - SWIGPendingException.Set(new System.NullReferenceException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve())); } static void SetPendingOutOfMemoryException(string message) { - SWIGPendingException.Set(new System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve())); } static void SetPendingOverflowException(string message) { - SWIGPendingException.Set(new System.OverflowException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve())); } static void SetPendingSystemException(string message) { - SWIGPendingException.Set(new System.SystemException(message, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve())); } static void SetPendingArgumentException(string message, string paramName) { - SWIGPendingException.Set(new System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); + SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve())); } static void SetPendingArgumentNullException(string message, string paramName) { - Exception e = SWIGPendingException.Retrieve(); + global::System.Exception e = SWIGPendingException.Retrieve(); if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new System.ArgumentNullException(paramName, message)); + SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message)); } static void SetPendingArgumentOutOfRangeException(string message, string paramName) { - Exception e = SWIGPendingException.Retrieve(); + global::System.Exception e = SWIGPendingException.Retrieve(); if (e != null) message = message + " Inner Exception: " + e.Message; - SWIGPendingException.Set(new System.ArgumentOutOfRangeException(paramName, message)); + SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message)); } static SWIGExceptionHelper() { @@ -126,9 +125,10 @@ static SWIGExceptionHelper() { protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); public class SWIGPendingException { - [ThreadStatic] - private static Exception pendingException = null; + [global::System.ThreadStatic] + private static global::System.Exception pendingException = null; private static int numExceptionsPending = 0; + private static global::System.Object exceptionsLock = null; public static bool Pending { get { @@ -140,28 +140,32 @@ public static bool Pending { } } - public static void Set(Exception e) { + public static void Set(global::System.Exception e) { if (pendingException != null) - throw new ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); + throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e); pendingException = e; - lock(typeof(MeCabPINVOKE)) { + lock(exceptionsLock) { numExceptionsPending++; } } - public static Exception Retrieve() { - Exception e = null; + public static global::System.Exception Retrieve() { + global::System.Exception e = null; if (numExceptionsPending > 0) { if (pendingException != null) { e = pendingException; pendingException = null; - lock(typeof(MeCabPINVOKE)) { + lock(exceptionsLock) { numExceptionsPending--; } } } return e; } + + static SWIGPendingException() { + exceptionsLock = new global::System.Object(); + } } @@ -170,7 +174,7 @@ protected class SWIGStringHelper { public delegate string SWIGStringDelegate(string message); static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString); - [DllImport("MeCab", EntryPoint="SWIGRegisterStringCallback_MeCab")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="SWIGRegisterStringCallback_MeCab")] public static extern void SWIGRegisterStringCallback_MeCab(SWIGStringDelegate stringDelegate); static string CreateString(string cString) { @@ -189,403 +193,391 @@ static MeCabPINVOKE() { } - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_filename_get")] - public static extern string DictionaryInfo_filename_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_filename_get")] + public static extern string DictionaryInfo_filename_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_charset_get")] - public static extern string DictionaryInfo_charset_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_charset_get")] + public static extern string DictionaryInfo_charset_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_size_get")] - public static extern uint DictionaryInfo_size_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_size_get")] + public static extern uint DictionaryInfo_size_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_type_get")] - public static extern int DictionaryInfo_type_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_type_get")] + public static extern int DictionaryInfo_type_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_lsize_get")] - public static extern uint DictionaryInfo_lsize_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_lsize_get")] + public static extern uint DictionaryInfo_lsize_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_rsize_get")] - public static extern uint DictionaryInfo_rsize_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_rsize_get")] + public static extern uint DictionaryInfo_rsize_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_version_get")] - public static extern ushort DictionaryInfo_version_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_version_get")] + public static extern ushort DictionaryInfo_version_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_DictionaryInfo_next_get")] - public static extern IntPtr DictionaryInfo_next_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_DictionaryInfo_next_get")] + public static extern global::System.IntPtr DictionaryInfo_next_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_new_DictionaryInfo")] - public static extern IntPtr new_DictionaryInfo(); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_new_DictionaryInfo")] + public static extern global::System.IntPtr new_DictionaryInfo(); - [DllImport("MeCab", EntryPoint="CSharp_delete_DictionaryInfo")] - public static extern void delete_DictionaryInfo(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_delete_DictionaryInfo")] + public static extern void delete_DictionaryInfo(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Path_rnode_get")] - public static extern IntPtr Path_rnode_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Path_rnode_get")] + public static extern global::System.IntPtr Path_rnode_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Path_rnext_get")] - public static extern IntPtr Path_rnext_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Path_rnext_get")] + public static extern global::System.IntPtr Path_rnext_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Path_lnode_get")] - public static extern IntPtr Path_lnode_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Path_lnode_get")] + public static extern global::System.IntPtr Path_lnode_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Path_lnext_get")] - public static extern IntPtr Path_lnext_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Path_lnext_get")] + public static extern global::System.IntPtr Path_lnext_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Path_cost_get")] - public static extern int Path_cost_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Path_cost_get")] + public static extern int Path_cost_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Path_prob_set")] - public static extern void Path_prob_set(HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Path_prob_set")] + public static extern void Path_prob_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Path_prob_get")] - public static extern float Path_prob_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Path_prob_get")] + public static extern float Path_prob_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_prev_get")] - public static extern IntPtr Node_prev_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_prev_get")] + public static extern global::System.IntPtr Node_prev_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_next_get")] - public static extern IntPtr Node_next_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_next_get")] + public static extern global::System.IntPtr Node_next_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_enext_get")] - public static extern IntPtr Node_enext_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_enext_get")] + public static extern global::System.IntPtr Node_enext_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_bnext_get")] - public static extern IntPtr Node_bnext_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_bnext_get")] + public static extern global::System.IntPtr Node_bnext_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_rpath_get")] - public static extern IntPtr Node_rpath_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_rpath_get")] + public static extern global::System.IntPtr Node_rpath_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_lpath_get")] - public static extern IntPtr Node_lpath_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_lpath_get")] + public static extern global::System.IntPtr Node_lpath_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_feature_get")] - public static extern string Node_feature_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_feature_get")] + public static extern string Node_feature_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_id_get")] - public static extern uint Node_id_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_id_get")] + public static extern uint Node_id_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_length_get")] - public static extern ushort Node_length_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_length_get")] + public static extern ushort Node_length_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_rlength_get")] - public static extern ushort Node_rlength_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_rlength_get")] + public static extern ushort Node_rlength_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_rcAttr_get")] - public static extern ushort Node_rcAttr_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_rcAttr_get")] + public static extern ushort Node_rcAttr_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_lcAttr_get")] - public static extern ushort Node_lcAttr_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_lcAttr_get")] + public static extern ushort Node_lcAttr_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_posid_get")] - public static extern ushort Node_posid_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_posid_get")] + public static extern ushort Node_posid_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_char_type_get")] - public static extern byte Node_char_type_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_char_type_get")] + public static extern byte Node_char_type_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_stat_get")] - public static extern byte Node_stat_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_stat_get")] + public static extern byte Node_stat_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_isbest_get")] - public static extern byte Node_isbest_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_isbest_get")] + public static extern byte Node_isbest_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_alpha_get")] - public static extern float Node_alpha_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_alpha_get")] + public static extern float Node_alpha_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_beta_get")] - public static extern float Node_beta_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_beta_get")] + public static extern float Node_beta_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_prob_set")] - public static extern void Node_prob_set(HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_prob_set")] + public static extern void Node_prob_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Node_prob_get")] - public static extern float Node_prob_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_prob_get")] + public static extern float Node_prob_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_wcost_get")] - public static extern short Node_wcost_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_wcost_get")] + public static extern short Node_wcost_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_cost_get")] - public static extern int Node_cost_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_cost_get")] + public static extern int Node_cost_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Node_surface_get")] - public static extern string Node_surface_get(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Node_surface_get")] + public static extern string Node_surface_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_NOR_NODE_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_NOR_NODE_get")] public static extern int MECAB_NOR_NODE_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_UNK_NODE_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_UNK_NODE_get")] public static extern int MECAB_UNK_NODE_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_BOS_NODE_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_BOS_NODE_get")] public static extern int MECAB_BOS_NODE_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_EOS_NODE_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_EOS_NODE_get")] public static extern int MECAB_EOS_NODE_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_EON_NODE_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_EON_NODE_get")] public static extern int MECAB_EON_NODE_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_SYS_DIC_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_SYS_DIC_get")] public static extern int MECAB_SYS_DIC_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_USR_DIC_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_USR_DIC_get")] public static extern int MECAB_USR_DIC_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_UNK_DIC_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_UNK_DIC_get")] public static extern int MECAB_UNK_DIC_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_ONE_BEST_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_ONE_BEST_get")] public static extern int MECAB_ONE_BEST_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_NBEST_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_NBEST_get")] public static extern int MECAB_NBEST_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_PARTIAL_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_PARTIAL_get")] public static extern int MECAB_PARTIAL_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_MARGINAL_PROB_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_MARGINAL_PROB_get")] public static extern int MECAB_MARGINAL_PROB_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_ALTERNATIVE_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_ALTERNATIVE_get")] public static extern int MECAB_ALTERNATIVE_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_ALL_MORPHS_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_ALL_MORPHS_get")] public static extern int MECAB_ALL_MORPHS_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_ALLOCATE_SENTENCE_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_ALLOCATE_SENTENCE_get")] public static extern int MECAB_ALLOCATE_SENTENCE_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_ANY_BOUNDARY_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_ANY_BOUNDARY_get")] public static extern int MECAB_ANY_BOUNDARY_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_TOKEN_BOUNDARY_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_TOKEN_BOUNDARY_get")] public static extern int MECAB_TOKEN_BOUNDARY_get(); - [DllImport("MeCab", EntryPoint="CSharp_MECAB_INSIDE_TOKEN_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_MECAB_INSIDE_TOKEN_get")] public static extern int MECAB_INSIDE_TOKEN_get(); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_clear")] - public static extern void Lattice_clear(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_clear")] + public static extern void Lattice_clear(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_is_available")] - public static extern bool Lattice_is_available(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_is_available")] + public static extern bool Lattice_is_available(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_bos_node")] - public static extern IntPtr Lattice_bos_node(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_bos_node")] + public static extern global::System.IntPtr Lattice_bos_node(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_eos_node")] - public static extern IntPtr Lattice_eos_node(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_eos_node")] + public static extern global::System.IntPtr Lattice_eos_node(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_end_nodes")] - public static extern IntPtr Lattice_end_nodes(HandleRef jarg1, uint jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_end_nodes")] + public static extern global::System.IntPtr Lattice_end_nodes(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_begin_nodes")] - public static extern IntPtr Lattice_begin_nodes(HandleRef jarg1, uint jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_begin_nodes")] + public static extern global::System.IntPtr Lattice_begin_nodes(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_sentence")] - public static extern string Lattice_sentence(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_sentence")] + public static extern string Lattice_sentence(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_size")] - public static extern uint Lattice_size(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_size")] + public static extern uint Lattice_size(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_Z")] - public static extern void Lattice_set_Z(HandleRef jarg1, double jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_Z")] + public static extern void Lattice_set_Z(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_Z")] - public static extern double Lattice_Z(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_Z")] + public static extern double Lattice_Z(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_theta")] - public static extern void Lattice_set_theta(HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_theta")] + public static extern void Lattice_set_theta(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_theta")] - public static extern float Lattice_theta(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_theta")] + public static extern float Lattice_theta(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_next")] - public static extern bool Lattice_next(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_next")] + public static extern bool Lattice_next(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_request_type")] - public static extern int Lattice_request_type(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_request_type")] + public static extern int Lattice_request_type(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_has_request_type")] - public static extern bool Lattice_has_request_type(HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_has_request_type")] + public static extern bool Lattice_has_request_type(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_request_type")] - public static extern void Lattice_set_request_type(HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_request_type")] + public static extern void Lattice_set_request_type(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_add_request_type")] - public static extern void Lattice_add_request_type(HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_add_request_type")] + public static extern void Lattice_add_request_type(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_remove_request_type")] - public static extern void Lattice_remove_request_type(HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_remove_request_type")] + public static extern void Lattice_remove_request_type(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_newNode")] - public static extern IntPtr Lattice_newNode(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_newNode")] + public static extern global::System.IntPtr Lattice_newNode(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_toString__SWIG_0")] - public static extern string Lattice_toString__SWIG_0(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_toString__SWIG_0")] + public static extern string Lattice_toString__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_toString__SWIG_1")] - public static extern string Lattice_toString__SWIG_1(HandleRef jarg1, HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_toString__SWIG_1")] + public static extern string Lattice_toString__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_enumNBestAsString")] - public static extern string Lattice_enumNBestAsString(HandleRef jarg1, uint jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_enumNBestAsString")] + public static extern string Lattice_enumNBestAsString(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_has_constraint")] - public static extern bool Lattice_has_constraint(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_has_constraint")] + public static extern bool Lattice_has_constraint(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_boundary_constraint")] - public static extern int Lattice_boundary_constraint(HandleRef jarg1, uint jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_boundary_constraint")] + public static extern int Lattice_boundary_constraint(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_feature_constraint")] - public static extern string Lattice_feature_constraint(HandleRef jarg1, uint jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_feature_constraint")] + public static extern string Lattice_feature_constraint(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_boundary_constraint")] - public static extern void Lattice_set_boundary_constraint(HandleRef jarg1, uint jarg2, int jarg3); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_boundary_constraint")] + public static extern void Lattice_set_boundary_constraint(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, int jarg3); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_feature_constraint")] - public static extern void Lattice_set_feature_constraint(HandleRef jarg1, uint jarg2, uint jarg3, string jarg4); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_feature_constraint")] + public static extern void Lattice_set_feature_constraint(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, uint jarg3, string jarg4); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_result")] - public static extern void Lattice_set_result(HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_result")] + public static extern void Lattice_set_result(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_what")] - public static extern string Lattice_what(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_what")] + public static extern string Lattice_what(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_what")] - public static extern void Lattice_set_what(HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_what")] + public static extern void Lattice_set_what(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [DllImport("MeCab", EntryPoint="CSharp_delete_Lattice")] - public static extern void delete_Lattice(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_delete_Lattice")] + public static extern void delete_Lattice(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_new_Lattice")] - public static extern IntPtr new_Lattice(); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_new_Lattice")] + public static extern global::System.IntPtr new_Lattice(); - [DllImport("MeCab", EntryPoint="CSharp_Lattice_set_sentence")] - public static extern void Lattice_set_sentence(HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Lattice_set_sentence")] + public static extern void Lattice_set_sentence(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Model_dictionary_info")] - public static extern IntPtr Model_dictionary_info(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Model_dictionary_info")] + public static extern global::System.IntPtr Model_dictionary_info(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Model_transition_cost")] - public static extern int Model_transition_cost(HandleRef jarg1, ushort jarg2, ushort jarg3); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Model_transition_cost")] + public static extern int Model_transition_cost(global::System.Runtime.InteropServices.HandleRef jarg1, ushort jarg2, ushort jarg3); - [DllImport("MeCab", EntryPoint="CSharp_Model_lookup")] - public static extern IntPtr Model_lookup(HandleRef jarg1, string jarg2, string jarg3, HandleRef jarg4); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Model_lookup")] + public static extern global::System.IntPtr Model_lookup(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, global::System.Runtime.InteropServices.HandleRef jarg4); - [DllImport("MeCab", EntryPoint="CSharp_Model_createTagger")] - public static extern IntPtr Model_createTagger(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Model_createTagger")] + public static extern global::System.IntPtr Model_createTagger(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Model_createLattice")] - public static extern IntPtr Model_createLattice(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Model_createLattice")] + public static extern global::System.IntPtr Model_createLattice(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Model_swap")] - public static extern bool Model_swap(HandleRef jarg1, HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Model_swap")] + public static extern bool Model_swap(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Model_version")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Model_version")] public static extern string Model_version(); - [DllImport("MeCab", EntryPoint="CSharp_delete_Model")] - public static extern void delete_Model(HandleRef jarg1); - - [DllImport("MeCab", EntryPoint="CSharp_Model_create__SWIG_0")] - public static extern IntPtr Model_create__SWIG_0(int jarg1, HandleRef jarg2); - - [DllImport("MeCab", EntryPoint="CSharp_Model_create__SWIG_1")] - public static extern IntPtr Model_create__SWIG_1(string jarg1); - - [DllImport("MeCab", EntryPoint="CSharp_new_Model__SWIG_0")] - public static extern IntPtr new_Model__SWIG_0(string jarg1); - - [DllImport("MeCab", EntryPoint="CSharp_new_Model__SWIG_1")] - public static extern IntPtr new_Model__SWIG_1(); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_delete_Model")] + public static extern void delete_Model(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parse__SWIG_0")] - public static extern bool Tagger_parse__SWIG_0(HandleRef jarg1, HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_new_Model__SWIG_0")] + public static extern global::System.IntPtr new_Model__SWIG_0(string jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parse__SWIG_1")] - public static extern bool Tagger_parse__SWIG_1(HandleRef jarg1, HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_new_Model__SWIG_1")] + public static extern global::System.IntPtr new_Model__SWIG_1(); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parse__SWIG_2")] - public static extern string Tagger_parse__SWIG_2(HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parse__SWIG_0")] + public static extern bool Tagger_parse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parseToNode")] - public static extern IntPtr Tagger_parseToNode(HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parse__SWIG_1")] + public static extern bool Tagger_parse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parseNBest")] - public static extern string Tagger_parseNBest(HandleRef jarg1, uint jarg2, string jarg3); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parse__SWIG_2")] + public static extern string Tagger_parse__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parseNBestInit")] - public static extern bool Tagger_parseNBestInit(HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parseToNode")] + public static extern global::System.IntPtr Tagger_parseToNode(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_nextNode")] - public static extern IntPtr Tagger_nextNode(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parseNBest")] + public static extern string Tagger_parseNBest(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, string jarg3); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_next")] - public static extern string Tagger_next(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parseNBestInit")] + public static extern bool Tagger_parseNBestInit(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_formatNode")] - public static extern string Tagger_formatNode(HandleRef jarg1, HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_nextNode")] + public static extern global::System.IntPtr Tagger_nextNode(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_set_request_type")] - public static extern void Tagger_set_request_type(HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_next")] + public static extern string Tagger_next(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_request_type")] - public static extern int Tagger_request_type(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_formatNode")] + public static extern string Tagger_formatNode(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_partial")] - public static extern bool Tagger_partial(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_set_request_type")] + public static extern void Tagger_set_request_type(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_set_partial")] - public static extern void Tagger_set_partial(HandleRef jarg1, bool jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_request_type")] + public static extern int Tagger_request_type(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_lattice_level")] - public static extern int Tagger_lattice_level(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_partial")] + public static extern bool Tagger_partial(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_set_lattice_level")] - public static extern void Tagger_set_lattice_level(HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_set_partial")] + public static extern void Tagger_set_partial(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_all_morphs")] - public static extern bool Tagger_all_morphs(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_lattice_level")] + public static extern int Tagger_lattice_level(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_set_all_morphs")] - public static extern void Tagger_set_all_morphs(HandleRef jarg1, bool jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_set_lattice_level")] + public static extern void Tagger_set_lattice_level(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_set_theta")] - public static extern void Tagger_set_theta(HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_all_morphs")] + public static extern bool Tagger_all_morphs(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_theta")] - public static extern float Tagger_theta(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_set_all_morphs")] + public static extern void Tagger_set_all_morphs(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_dictionary_info")] - public static extern IntPtr Tagger_dictionary_info(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_set_theta")] + public static extern void Tagger_set_theta(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_what")] - public static extern string Tagger_what(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_theta")] + public static extern float Tagger_theta(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_delete_Tagger")] - public static extern void delete_Tagger(HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_dictionary_info")] + public static extern global::System.IntPtr Tagger_dictionary_info(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_create__SWIG_0")] - public static extern IntPtr Tagger_create__SWIG_0(int jarg1, HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_what")] + public static extern string Tagger_what(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_create__SWIG_1")] - public static extern IntPtr Tagger_create__SWIG_1(string jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_delete_Tagger")] + public static extern void delete_Tagger(global::System.Runtime.InteropServices.HandleRef jarg1); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_version")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_version")] public static extern string Tagger_version(); - [DllImport("MeCab", EntryPoint="CSharp_new_Tagger__SWIG_0")] - public static extern IntPtr new_Tagger__SWIG_0(string jarg1); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_new_Tagger__SWIG_0")] + public static extern global::System.IntPtr new_Tagger__SWIG_0(string jarg1); - [DllImport("MeCab", EntryPoint="CSharp_new_Tagger__SWIG_1")] - public static extern IntPtr new_Tagger__SWIG_1(); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_new_Tagger__SWIG_1")] + public static extern global::System.IntPtr new_Tagger__SWIG_1(); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parseToString__SWIG_0")] - public static extern string Tagger_parseToString__SWIG_0(HandleRef jarg1, string jarg2, uint jarg3); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parseToString__SWIG_0")] + public static extern string Tagger_parseToString__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, uint jarg3); - [DllImport("MeCab", EntryPoint="CSharp_Tagger_parseToString__SWIG_1")] - public static extern string Tagger_parseToString__SWIG_1(HandleRef jarg1, string jarg2); + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_Tagger_parseToString__SWIG_1")] + public static extern string Tagger_parseToString__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - [DllImport("MeCab", EntryPoint="CSharp_VERSION_get")] + [global::System.Runtime.InteropServices.DllImport("MeCab", EntryPoint="CSharp_MeCab_VERSION_get")] public static extern string VERSION_get(); } diff --git a/mecab/csharp/MeCab_wrap.cxx b/mecab/csharp/MeCab_wrap.cxx index f66febe..cdd80d5 100644 --- a/mecab/csharp/MeCab_wrap.cxx +++ b/mecab/csharp/MeCab_wrap.cxx @@ -1,14 +1,18 @@ /* ---------------------------------------------------------------------------- * 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 4.0.2 + * + * 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 SWIGCSHARP #define SWIGCSHARP +#endif + #ifdef __cplusplus @@ -65,28 +69,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 @@ -101,9 +105,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 @@ -129,7 +135,7 @@ template T SwigValueInit() { # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL -# endif +# endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ @@ -142,6 +148,19 @@ 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 #include @@ -280,18 +299,18 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_MeCab(SWIG_CSharpStringHe #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else /* 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 @@ -333,6 +352,7 @@ SWIGINTERN void SWIG_CSharpException(int code, const char *msg) { } +#include #include @@ -419,7 +439,7 @@ SWIGINTERN char const *MeCab_Tagger_parseToString__SWIG_0(MeCab::Tagger *self,ch extern "C" { #endif -SWIGEXPORT char * SWIGSTDCALL CSharp_DictionaryInfo_filename_get(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_DictionaryInfo_filename_get(void * jarg1) { char * jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; char *result = 0 ; @@ -431,7 +451,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_DictionaryInfo_filename_get(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_DictionaryInfo_charset_get(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_DictionaryInfo_charset_get(void * jarg1) { char * jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; char *result = 0 ; @@ -443,7 +463,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_DictionaryInfo_charset_get(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_DictionaryInfo_size_get(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_DictionaryInfo_size_get(void * jarg1) { unsigned int jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned int result; @@ -455,7 +475,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_DictionaryInfo_size_get(void * jarg1) } -SWIGEXPORT int SWIGSTDCALL CSharp_DictionaryInfo_type_get(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_DictionaryInfo_type_get(void * jarg1) { int jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; int result; @@ -467,7 +487,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_DictionaryInfo_type_get(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_DictionaryInfo_lsize_get(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_DictionaryInfo_lsize_get(void * jarg1) { unsigned int jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned int result; @@ -479,7 +499,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_DictionaryInfo_lsize_get(void * jarg1 } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_DictionaryInfo_rsize_get(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_DictionaryInfo_rsize_get(void * jarg1) { unsigned int jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned int result; @@ -491,7 +511,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_DictionaryInfo_rsize_get(void * jarg1 } -SWIGEXPORT unsigned short SWIGSTDCALL CSharp_DictionaryInfo_version_get(void * jarg1) { +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_MeCab_DictionaryInfo_version_get(void * jarg1) { unsigned short jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned short result; @@ -503,7 +523,7 @@ SWIGEXPORT unsigned short SWIGSTDCALL CSharp_DictionaryInfo_version_get(void * j } -SWIGEXPORT void * SWIGSTDCALL CSharp_DictionaryInfo_next_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_DictionaryInfo_next_get(void * jarg1) { void * jresult ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; mecab_dictionary_info_t *result = 0 ; @@ -515,7 +535,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_DictionaryInfo_next_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_new_DictionaryInfo() { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_new_DictionaryInfo() { void * jresult ; mecab_dictionary_info_t *result = 0 ; @@ -539,7 +559,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_DictionaryInfo() { } -SWIGEXPORT void SWIGSTDCALL CSharp_delete_DictionaryInfo(void * jarg1) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_delete_DictionaryInfo(void * jarg1) { mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; arg1 = (mecab_dictionary_info_t *)jarg1; @@ -561,7 +581,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_DictionaryInfo(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Path_rnode_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Path_rnode_get(void * jarg1) { void * jresult ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_node_t *result = 0 ; @@ -573,7 +593,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Path_rnode_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Path_rnext_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Path_rnext_get(void * jarg1) { void * jresult ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_path_t *result = 0 ; @@ -585,7 +605,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Path_rnext_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Path_lnode_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Path_lnode_get(void * jarg1) { void * jresult ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_node_t *result = 0 ; @@ -597,7 +617,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Path_lnode_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Path_lnext_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Path_lnext_get(void * jarg1) { void * jresult ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_path_t *result = 0 ; @@ -609,7 +629,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Path_lnext_get(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_Path_cost_get(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_Path_cost_get(void * jarg1) { int jresult ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; int result; @@ -621,7 +641,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Path_cost_get(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Path_prob_set(void * jarg1, float jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Path_prob_set(void * jarg1, float jarg2) { mecab_path_t *arg1 = (mecab_path_t *) 0 ; float arg2 ; @@ -631,7 +651,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Path_prob_set(void * jarg1, float jarg2) { } -SWIGEXPORT float SWIGSTDCALL CSharp_Path_prob_get(void * jarg1) { +SWIGEXPORT float SWIGSTDCALL CSharp_MeCab_Path_prob_get(void * jarg1) { float jresult ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; float result; @@ -643,7 +663,7 @@ SWIGEXPORT float SWIGSTDCALL CSharp_Path_prob_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Node_prev_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Node_prev_get(void * jarg1) { void * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; @@ -655,7 +675,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Node_prev_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Node_next_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Node_next_get(void * jarg1) { void * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; @@ -667,7 +687,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Node_next_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Node_enext_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Node_enext_get(void * jarg1) { void * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; @@ -679,7 +699,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Node_enext_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Node_bnext_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Node_bnext_get(void * jarg1) { void * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; @@ -691,7 +711,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Node_bnext_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Node_rpath_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Node_rpath_get(void * jarg1) { void * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_path_t *result = 0 ; @@ -703,7 +723,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Node_rpath_get(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Node_lpath_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Node_lpath_get(void * jarg1) { void * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_path_t *result = 0 ; @@ -715,7 +735,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Node_lpath_get(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Node_feature_get(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Node_feature_get(void * jarg1) { char * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; char *result = 0 ; @@ -727,7 +747,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Node_feature_get(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Node_id_get(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Node_id_get(void * jarg1) { unsigned int jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned int result; @@ -739,7 +759,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Node_id_get(void * jarg1) { } -SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_length_get(void * jarg1) { +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_MeCab_Node_length_get(void * jarg1) { unsigned short jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; @@ -751,7 +771,7 @@ SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_length_get(void * jarg1) { } -SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_rlength_get(void * jarg1) { +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_MeCab_Node_rlength_get(void * jarg1) { unsigned short jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; @@ -763,7 +783,7 @@ SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_rlength_get(void * jarg1) { } -SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_rcAttr_get(void * jarg1) { +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_MeCab_Node_rcAttr_get(void * jarg1) { unsigned short jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; @@ -775,7 +795,7 @@ SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_rcAttr_get(void * jarg1) { } -SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_lcAttr_get(void * jarg1) { +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_MeCab_Node_lcAttr_get(void * jarg1) { unsigned short jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; @@ -787,7 +807,7 @@ SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_lcAttr_get(void * jarg1) { } -SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_posid_get(void * jarg1) { +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_MeCab_Node_posid_get(void * jarg1) { unsigned short jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; @@ -799,7 +819,7 @@ SWIGEXPORT unsigned short SWIGSTDCALL CSharp_Node_posid_get(void * jarg1) { } -SWIGEXPORT unsigned char SWIGSTDCALL CSharp_Node_char_type_get(void * jarg1) { +SWIGEXPORT unsigned char SWIGSTDCALL CSharp_MeCab_Node_char_type_get(void * jarg1) { unsigned char jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned char result; @@ -811,7 +831,7 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_Node_char_type_get(void * jarg1) { } -SWIGEXPORT unsigned char SWIGSTDCALL CSharp_Node_stat_get(void * jarg1) { +SWIGEXPORT unsigned char SWIGSTDCALL CSharp_MeCab_Node_stat_get(void * jarg1) { unsigned char jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned char result; @@ -823,7 +843,7 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_Node_stat_get(void * jarg1) { } -SWIGEXPORT unsigned char SWIGSTDCALL CSharp_Node_isbest_get(void * jarg1) { +SWIGEXPORT unsigned char SWIGSTDCALL CSharp_MeCab_Node_isbest_get(void * jarg1) { unsigned char jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned char result; @@ -835,7 +855,7 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_Node_isbest_get(void * jarg1) { } -SWIGEXPORT float SWIGSTDCALL CSharp_Node_alpha_get(void * jarg1) { +SWIGEXPORT float SWIGSTDCALL CSharp_MeCab_Node_alpha_get(void * jarg1) { float jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; float result; @@ -847,7 +867,7 @@ SWIGEXPORT float SWIGSTDCALL CSharp_Node_alpha_get(void * jarg1) { } -SWIGEXPORT float SWIGSTDCALL CSharp_Node_beta_get(void * jarg1) { +SWIGEXPORT float SWIGSTDCALL CSharp_MeCab_Node_beta_get(void * jarg1) { float jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; float result; @@ -859,7 +879,7 @@ SWIGEXPORT float SWIGSTDCALL CSharp_Node_beta_get(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Node_prob_set(void * jarg1, float jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Node_prob_set(void * jarg1, float jarg2) { mecab_node_t *arg1 = (mecab_node_t *) 0 ; float arg2 ; @@ -869,7 +889,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Node_prob_set(void * jarg1, float jarg2) { } -SWIGEXPORT float SWIGSTDCALL CSharp_Node_prob_get(void * jarg1) { +SWIGEXPORT float SWIGSTDCALL CSharp_MeCab_Node_prob_get(void * jarg1) { float jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; float result; @@ -881,7 +901,7 @@ SWIGEXPORT float SWIGSTDCALL CSharp_Node_prob_get(void * jarg1) { } -SWIGEXPORT short SWIGSTDCALL CSharp_Node_wcost_get(void * jarg1) { +SWIGEXPORT short SWIGSTDCALL CSharp_MeCab_Node_wcost_get(void * jarg1) { short jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; short result; @@ -893,7 +913,7 @@ SWIGEXPORT short SWIGSTDCALL CSharp_Node_wcost_get(void * jarg1) { } -SWIGEXPORT long SWIGSTDCALL CSharp_Node_cost_get(void * jarg1) { +SWIGEXPORT long SWIGSTDCALL CSharp_MeCab_Node_cost_get(void * jarg1) { long jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; long result; @@ -905,7 +925,7 @@ SWIGEXPORT long SWIGSTDCALL CSharp_Node_cost_get(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Node_surface_get(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Node_surface_get(void * jarg1) { char * jresult ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; char *result = 0 ; @@ -932,7 +952,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Node_surface_get(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_NOR_NODE_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_NOR_NODE_get() { int jresult ; int result; @@ -951,12 +971,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_NOR_NODE_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_UNK_NODE_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_UNK_NODE_get() { int jresult ; int result; @@ -975,12 +995,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_UNK_NODE_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_BOS_NODE_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_BOS_NODE_get() { int jresult ; int result; @@ -999,12 +1019,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_BOS_NODE_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_EOS_NODE_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_EOS_NODE_get() { int jresult ; int result; @@ -1023,12 +1043,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_EOS_NODE_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_EON_NODE_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_EON_NODE_get() { int jresult ; int result; @@ -1047,12 +1067,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_EON_NODE_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_SYS_DIC_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_SYS_DIC_get() { int jresult ; int result; @@ -1071,12 +1091,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_SYS_DIC_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_USR_DIC_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_USR_DIC_get() { int jresult ; int result; @@ -1095,12 +1115,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_USR_DIC_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_UNK_DIC_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_UNK_DIC_get() { int jresult ; int result; @@ -1119,12 +1139,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_UNK_DIC_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ONE_BEST_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_ONE_BEST_get() { int jresult ; int result; @@ -1143,12 +1163,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ONE_BEST_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_NBEST_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_NBEST_get() { int jresult ; int result; @@ -1167,12 +1187,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_NBEST_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_PARTIAL_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_PARTIAL_get() { int jresult ; int result; @@ -1191,12 +1211,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_PARTIAL_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_MARGINAL_PROB_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_MARGINAL_PROB_get() { int jresult ; int result; @@ -1215,12 +1235,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_MARGINAL_PROB_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ALTERNATIVE_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_ALTERNATIVE_get() { int jresult ; int result; @@ -1239,12 +1259,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ALTERNATIVE_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ALL_MORPHS_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_ALL_MORPHS_get() { int jresult ; int result; @@ -1263,12 +1283,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ALL_MORPHS_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ALLOCATE_SENTENCE_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_ALLOCATE_SENTENCE_get() { int jresult ; int result; @@ -1287,12 +1307,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ALLOCATE_SENTENCE_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ANY_BOUNDARY_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_ANY_BOUNDARY_get() { int jresult ; int result; @@ -1311,12 +1331,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_ANY_BOUNDARY_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_TOKEN_BOUNDARY_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_TOKEN_BOUNDARY_get() { int jresult ; int result; @@ -1335,12 +1355,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_TOKEN_BOUNDARY_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_INSIDE_TOKEN_get() { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_MECAB_INSIDE_TOKEN_get() { int jresult ; int result; @@ -1359,12 +1379,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MECAB_INSIDE_TOKEN_get() { }; } } - jresult = result; + jresult = (int)result; return jresult; } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_clear(void * jarg1) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_clear(void * jarg1) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; arg1 = (MeCab::Lattice *)jarg1; @@ -1386,7 +1406,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_clear(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_is_available(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Lattice_is_available(void * jarg1) { unsigned int jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; bool result; @@ -1412,7 +1432,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_is_available(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_bos_node(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Lattice_bos_node(void * jarg1) { void * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *result = 0 ; @@ -1438,7 +1458,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_bos_node(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_eos_node(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Lattice_eos_node(void * jarg1) { void * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *result = 0 ; @@ -1464,7 +1484,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_eos_node(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_end_nodes(void * jarg1, unsigned long jarg2) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Lattice_end_nodes(void * jarg1, unsigned long jarg2) { void * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; @@ -1492,7 +1512,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_end_nodes(void * jarg1, unsigned lo } -SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_begin_nodes(void * jarg1, unsigned long jarg2) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Lattice_begin_nodes(void * jarg1, unsigned long jarg2) { void * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; @@ -1520,7 +1540,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_begin_nodes(void * jarg1, unsigned } -SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_sentence(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Lattice_sentence(void * jarg1) { char * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *result = 0 ; @@ -1546,7 +1566,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_sentence(void * jarg1) { } -SWIGEXPORT unsigned long SWIGSTDCALL CSharp_Lattice_size(void * jarg1) { +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_MeCab_Lattice_size(void * jarg1) { unsigned long jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t result; @@ -1572,7 +1592,7 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_Lattice_size(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_Z(void * jarg1, double jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_Z(void * jarg1, double jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; double arg2 ; @@ -1596,7 +1616,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_Z(void * jarg1, double jarg2) { } -SWIGEXPORT double SWIGSTDCALL CSharp_Lattice_Z(void * jarg1) { +SWIGEXPORT double SWIGSTDCALL CSharp_MeCab_Lattice_Z(void * jarg1) { double jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; double result; @@ -1622,7 +1642,7 @@ SWIGEXPORT double SWIGSTDCALL CSharp_Lattice_Z(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_theta(void * jarg1, float jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_theta(void * jarg1, float jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; float arg2 ; @@ -1646,7 +1666,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_theta(void * jarg1, float jarg2) } -SWIGEXPORT float SWIGSTDCALL CSharp_Lattice_theta(void * jarg1) { +SWIGEXPORT float SWIGSTDCALL CSharp_MeCab_Lattice_theta(void * jarg1) { float jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; float result; @@ -1672,7 +1692,7 @@ SWIGEXPORT float SWIGSTDCALL CSharp_Lattice_theta(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_next(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Lattice_next(void * jarg1) { unsigned int jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; bool result; @@ -1698,7 +1718,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_next(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_Lattice_request_type(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_Lattice_request_type(void * jarg1) { int jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int result; @@ -1724,7 +1744,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Lattice_request_type(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_has_request_type(void * jarg1, int jarg2) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Lattice_has_request_type(void * jarg1, int jarg2) { unsigned int jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; @@ -1752,7 +1772,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_has_request_type(void * jarg1 } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_request_type(void * jarg1, int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_request_type(void * jarg1, int jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; @@ -1776,7 +1796,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_request_type(void * jarg1, int ja } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_add_request_type(void * jarg1, int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_add_request_type(void * jarg1, int jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; @@ -1800,7 +1820,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_add_request_type(void * jarg1, int ja } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_remove_request_type(void * jarg1, int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_remove_request_type(void * jarg1, int jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; @@ -1824,7 +1844,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_remove_request_type(void * jarg1, int } -SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_newNode(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Lattice_newNode(void * jarg1) { void * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *result = 0 ; @@ -1850,7 +1870,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Lattice_newNode(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_toString__SWIG_0(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Lattice_toString__SWIG_0(void * jarg1) { char * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *result = 0 ; @@ -1876,7 +1896,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_toString__SWIG_0(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_toString__SWIG_1(void * jarg1, void * jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Lattice_toString__SWIG_1(void * jarg1, void * jarg2) { char * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *arg2 = (MeCab::Node *) 0 ; @@ -1904,7 +1924,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_toString__SWIG_1(void * jarg1, void } -SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_enumNBestAsString(void * jarg1, unsigned long jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Lattice_enumNBestAsString(void * jarg1, unsigned long jarg2) { char * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; @@ -1932,7 +1952,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_enumNBestAsString(void * jarg1, uns } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_has_constraint(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Lattice_has_constraint(void * jarg1) { unsigned int jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; bool result; @@ -1958,7 +1978,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Lattice_has_constraint(void * jarg1) } -SWIGEXPORT int SWIGSTDCALL CSharp_Lattice_boundary_constraint(void * jarg1, unsigned long jarg2) { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_Lattice_boundary_constraint(void * jarg1, unsigned long jarg2) { int jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; @@ -1986,7 +2006,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Lattice_boundary_constraint(void * jarg1, unsi } -SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_feature_constraint(void * jarg1, unsigned long jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Lattice_feature_constraint(void * jarg1, unsigned long jarg2) { char * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; @@ -2014,7 +2034,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_feature_constraint(void * jarg1, un } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_boundary_constraint(void * jarg1, unsigned long jarg2, int jarg3) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_boundary_constraint(void * jarg1, unsigned long jarg2, int jarg3) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; int arg3 ; @@ -2040,7 +2060,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_boundary_constraint(void * jarg1, } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_feature_constraint(void * jarg1, unsigned long jarg2, unsigned long jarg3, char * jarg4) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_feature_constraint(void * jarg1, unsigned long jarg2, unsigned long jarg3, char * jarg4) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; size_t arg3 ; @@ -2068,7 +2088,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_feature_constraint(void * jarg1, } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_result(void * jarg1, char * jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_result(void * jarg1, char * jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *arg2 = (char *) 0 ; @@ -2092,7 +2112,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_result(void * jarg1, char * jarg2 } -SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_what(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Lattice_what(void * jarg1) { char * jresult ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *result = 0 ; @@ -2118,7 +2138,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Lattice_what(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_what(void * jarg1, char * jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_what(void * jarg1, char * jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *arg2 = (char *) 0 ; @@ -2142,7 +2162,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_what(void * jarg1, char * jarg2) } -SWIGEXPORT void SWIGSTDCALL CSharp_delete_Lattice(void * jarg1) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_delete_Lattice(void * jarg1) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; arg1 = (MeCab::Lattice *)jarg1; @@ -2164,7 +2184,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_Lattice(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_new_Lattice() { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_new_Lattice() { void * jresult ; MeCab::Lattice *result = 0 ; @@ -2188,7 +2208,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_Lattice() { } -SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_sentence(void * jarg1, char * jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Lattice_set_sentence(void * jarg1, char * jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *arg2 = (char *) 0 ; @@ -2212,7 +2232,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Lattice_set_sentence(void * jarg1, char * jar } -SWIGEXPORT void * SWIGSTDCALL CSharp_Model_dictionary_info(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Model_dictionary_info(void * jarg1) { void * jresult ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::DictionaryInfo *result = 0 ; @@ -2238,7 +2258,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Model_dictionary_info(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_Model_transition_cost(void * jarg1, unsigned short jarg2, unsigned short jarg3) { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_Model_transition_cost(void * jarg1, unsigned short jarg2, unsigned short jarg3) { int jresult ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; unsigned short arg2 ; @@ -2268,7 +2288,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Model_transition_cost(void * jarg1, unsigned s } -SWIGEXPORT void * SWIGSTDCALL CSharp_Model_lookup(void * jarg1, char * jarg2, char * jarg3, void * jarg4) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Model_lookup(void * jarg1, char * jarg2, char * jarg3, void * jarg4) { void * jresult ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; char *arg2 = (char *) 0 ; @@ -2300,7 +2320,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Model_lookup(void * jarg1, char * jarg2, ch } -SWIGEXPORT void * SWIGSTDCALL CSharp_Model_createTagger(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Model_createTagger(void * jarg1) { void * jresult ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::Tagger *result = 0 ; @@ -2326,7 +2346,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Model_createTagger(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Model_createLattice(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Model_createLattice(void * jarg1) { void * jresult ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::Lattice *result = 0 ; @@ -2352,7 +2372,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Model_createLattice(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Model_swap(void * jarg1, void * jarg2) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Model_swap(void * jarg1, void * jarg2) { unsigned int jresult ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::Model *arg2 = (MeCab::Model *) 0 ; @@ -2380,7 +2400,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Model_swap(void * jarg1, void * jarg2 } -SWIGEXPORT char * SWIGSTDCALL CSharp_Model_version() { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Model_version() { char * jresult ; char *result = 0 ; @@ -2404,7 +2424,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Model_version() { } -SWIGEXPORT void SWIGSTDCALL CSharp_delete_Model(void * jarg1) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_delete_Model(void * jarg1) { MeCab::Model *arg1 = (MeCab::Model *) 0 ; arg1 = (MeCab::Model *)jarg1; @@ -2426,61 +2446,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_Model(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Model_create__SWIG_0(int jarg1, void * jarg2) { - void * jresult ; - int arg1 ; - char **arg2 = (char **) 0 ; - MeCab::Model *result = 0 ; - - arg1 = (int)jarg1; - arg2 = (char **)jarg2; - { - try { - result = (MeCab::Model *)MeCab::Model::create(arg1,arg2); - } - catch (char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_Model_create__SWIG_1(char * jarg1) { - void * jresult ; - char *arg1 = (char *) 0 ; - MeCab::Model *result = 0 ; - - arg1 = (char *)jarg1; - { - try { - result = (MeCab::Model *)MeCab::Model::create((char const *)arg1); - } - catch (char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_Model__SWIG_0(char * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_new_Model__SWIG_0(char * jarg1) { void * jresult ; char *arg1 = (char *) 0 ; MeCab::Model *result = 0 ; @@ -2506,7 +2472,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_Model__SWIG_0(char * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_new_Model__SWIG_1() { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_new_Model__SWIG_1() { void * jresult ; MeCab::Model *result = 0 ; @@ -2530,7 +2496,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_Model__SWIG_1() { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_parse__SWIG_0(void * jarg1, void * jarg2) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Tagger_parse__SWIG_0(void * jarg1, void * jarg2) { unsigned int jresult ; MeCab::Model *arg1 = 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; @@ -2562,7 +2528,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_parse__SWIG_0(void * jarg1, vo } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_parse__SWIG_1(void * jarg1, void * jarg2) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Tagger_parse__SWIG_1(void * jarg1, void * jarg2) { unsigned int jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; @@ -2590,7 +2556,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_parse__SWIG_1(void * jarg1, vo } -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parse__SWIG_2(void * jarg1, char * jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_parse__SWIG_2(void * jarg1, char * jarg2) { char * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -2618,7 +2584,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parse__SWIG_2(void * jarg1, char * j } -SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_parseToNode(void * jarg1, char * jarg2) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Tagger_parseToNode(void * jarg1, char * jarg2) { void * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -2646,7 +2612,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_parseToNode(void * jarg1, char * jar } -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parseNBest(void * jarg1, unsigned long jarg2, char * jarg3) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_parseNBest(void * jarg1, unsigned long jarg2, char * jarg3) { char * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; size_t arg2 ; @@ -2676,7 +2642,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parseNBest(void * jarg1, unsigned lo } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_parseNBestInit(void * jarg1, char * jarg2) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Tagger_parseNBestInit(void * jarg1, char * jarg2) { unsigned int jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -2704,7 +2670,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_parseNBestInit(void * jarg1, c } -SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_nextNode(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Tagger_nextNode(void * jarg1) { void * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Node *result = 0 ; @@ -2730,7 +2696,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_nextNode(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_next(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_next(void * jarg1) { char * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *result = 0 ; @@ -2756,7 +2722,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_next(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_formatNode(void * jarg1, void * jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_formatNode(void * jarg1, void * jarg2) { char * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Node *arg2 = (MeCab::Node *) 0 ; @@ -2784,7 +2750,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_formatNode(void * jarg1, void * jarg } -SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_request_type(void * jarg1, int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Tagger_set_request_type(void * jarg1, int jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int arg2 ; @@ -2808,7 +2774,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_request_type(void * jarg1, int jar } -SWIGEXPORT int SWIGSTDCALL CSharp_Tagger_request_type(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_Tagger_request_type(void * jarg1) { int jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int result; @@ -2834,7 +2800,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Tagger_request_type(void * jarg1) { } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_partial(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Tagger_partial(void * jarg1) { unsigned int jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool result; @@ -2860,7 +2826,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_partial(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_partial(void * jarg1, unsigned int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Tagger_set_partial(void * jarg1, unsigned int jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool arg2 ; @@ -2884,7 +2850,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_partial(void * jarg1, unsigned int } -SWIGEXPORT int SWIGSTDCALL CSharp_Tagger_lattice_level(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_MeCab_Tagger_lattice_level(void * jarg1) { int jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int result; @@ -2910,7 +2876,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Tagger_lattice_level(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_lattice_level(void * jarg1, int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Tagger_set_lattice_level(void * jarg1, int jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int arg2 ; @@ -2934,7 +2900,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_lattice_level(void * jarg1, int ja } -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_all_morphs(void * jarg1) { +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MeCab_Tagger_all_morphs(void * jarg1) { unsigned int jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool result; @@ -2960,7 +2926,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Tagger_all_morphs(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_all_morphs(void * jarg1, unsigned int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Tagger_set_all_morphs(void * jarg1, unsigned int jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool arg2 ; @@ -2984,7 +2950,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_all_morphs(void * jarg1, unsigned } -SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_theta(void * jarg1, float jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_Tagger_set_theta(void * jarg1, float jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; float arg2 ; @@ -3008,7 +2974,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Tagger_set_theta(void * jarg1, float jarg2) { } -SWIGEXPORT float SWIGSTDCALL CSharp_Tagger_theta(void * jarg1) { +SWIGEXPORT float SWIGSTDCALL CSharp_MeCab_Tagger_theta(void * jarg1) { float jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; float result; @@ -3034,7 +3000,7 @@ SWIGEXPORT float SWIGSTDCALL CSharp_Tagger_theta(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_dictionary_info(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_Tagger_dictionary_info(void * jarg1) { void * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::DictionaryInfo *result = 0 ; @@ -3060,7 +3026,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_dictionary_info(void * jarg1) { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_what(void * jarg1) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_what(void * jarg1) { char * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *result = 0 ; @@ -3086,7 +3052,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_what(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_delete_Tagger(void * jarg1) { +SWIGEXPORT void SWIGSTDCALL CSharp_MeCab_delete_Tagger(void * jarg1) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; arg1 = (MeCab::Tagger *)jarg1; @@ -3108,61 +3074,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_Tagger(void * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_create__SWIG_0(int jarg1, void * jarg2) { - void * jresult ; - int arg1 ; - char **arg2 = (char **) 0 ; - MeCab::Tagger *result = 0 ; - - arg1 = (int)jarg1; - arg2 = (char **)jarg2; - { - try { - result = (MeCab::Tagger *)MeCab::Tagger::create(arg1,arg2); - } - catch (char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_Tagger_create__SWIG_1(char * jarg1) { - void * jresult ; - char *arg1 = (char *) 0 ; - MeCab::Tagger *result = 0 ; - - arg1 = (char *)jarg1; - { - try { - result = (MeCab::Tagger *)MeCab::Tagger::create((char const *)arg1); - } - catch (char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_CSharpException(SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_version() { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_version() { char * jresult ; char *result = 0 ; @@ -3186,7 +3098,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_version() { } -SWIGEXPORT void * SWIGSTDCALL CSharp_new_Tagger__SWIG_0(char * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_new_Tagger__SWIG_0(char * jarg1) { void * jresult ; char *arg1 = (char *) 0 ; MeCab::Tagger *result = 0 ; @@ -3212,7 +3124,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_Tagger__SWIG_0(char * jarg1) { } -SWIGEXPORT void * SWIGSTDCALL CSharp_new_Tagger__SWIG_1() { +SWIGEXPORT void * SWIGSTDCALL CSharp_MeCab_new_Tagger__SWIG_1() { void * jresult ; MeCab::Tagger *result = 0 ; @@ -3236,7 +3148,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_Tagger__SWIG_1() { } -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parseToString__SWIG_0(void * jarg1, char * jarg2, unsigned long jarg3) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_parseToString__SWIG_0(void * jarg1, char * jarg2, unsigned long jarg3) { char * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -3266,7 +3178,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parseToString__SWIG_0(void * jarg1, } -SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parseToString__SWIG_1(void * jarg1, char * jarg2) { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_Tagger_parseToString__SWIG_1(void * jarg1, char * jarg2) { char * jresult ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -3294,7 +3206,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Tagger_parseToString__SWIG_1(void * jarg1, } -SWIGEXPORT char * SWIGSTDCALL CSharp_VERSION_get() { +SWIGEXPORT char * SWIGSTDCALL CSharp_MeCab_VERSION_get() { char * jresult ; char *result = 0 ; diff --git a/mecab/csharp/Model.cs b/mecab/csharp/Model.cs index ac3afb9..cb00e98 100644 --- a/mecab/csharp/Model.cs +++ b/mecab/csharp/Model.cs @@ -1,49 +1,52 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - -public class Model : IDisposable { - private HandleRef swigCPtr; +public class Model : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal Model(IntPtr cPtr, bool cMemoryOwn) { + internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; - swigCPtr = new HandleRef(this, cPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static HandleRef getCPtr(Model obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Model obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Model() { - Dispose(); + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); } - public virtual void Dispose() { + protected virtual void Dispose(bool disposing) { lock(this) { - if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; MeCabPINVOKE.delete_Model(swigCPtr); } - swigCPtr = new HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - GC.SuppressFinalize(this); } } public virtual DictionaryInfo dictionary_info() { - IntPtr cPtr = MeCabPINVOKE.Model_dictionary_info(swigCPtr); - DictionaryInfo ret = (cPtr == IntPtr.Zero) ? null : new DictionaryInfo(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Model_dictionary_info(swigCPtr); + DictionaryInfo ret = (cPtr == global::System.IntPtr.Zero) ? null : new DictionaryInfo(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -55,22 +58,22 @@ public virtual int transition_cost(ushort rcAttr, ushort lcAttr) { } public virtual Node lookup(string begin, string end, Lattice lattice) { - IntPtr cPtr = MeCabPINVOKE.Model_lookup(swigCPtr, begin, end, Lattice.getCPtr(lattice)); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Model_lookup(swigCPtr, begin, end, Lattice.getCPtr(lattice)); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } public virtual Tagger createTagger() { - IntPtr cPtr = MeCabPINVOKE.Model_createTagger(swigCPtr); - Tagger ret = (cPtr == IntPtr.Zero) ? null : new Tagger(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Model_createTagger(swigCPtr); + Tagger ret = (cPtr == global::System.IntPtr.Zero) ? null : new Tagger(cPtr, true); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } public virtual Lattice createLattice() { - IntPtr cPtr = MeCabPINVOKE.Model_createLattice(swigCPtr); - Lattice ret = (cPtr == IntPtr.Zero) ? null : new Lattice(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Model_createLattice(swigCPtr); + Lattice ret = (cPtr == global::System.IntPtr.Zero) ? null : new Lattice(cPtr, true); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -87,20 +90,6 @@ public static string version() { return ret; } - public static Model create(int argc, SWIGTYPE_p_p_char argv) { - IntPtr cPtr = MeCabPINVOKE.Model_create__SWIG_0(argc, SWIGTYPE_p_p_char.getCPtr(argv)); - Model ret = (cPtr == IntPtr.Zero) ? null : new Model(cPtr, false); - if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static Model create(string arg) { - IntPtr cPtr = MeCabPINVOKE.Model_create__SWIG_1(arg); - Model ret = (cPtr == IntPtr.Zero) ? null : new Model(cPtr, false); - if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public Model(string argc) : this(MeCabPINVOKE.new_Model__SWIG_0(argc), true) { if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); } diff --git a/mecab/csharp/Node.cs b/mecab/csharp/Node.cs index c49b86f..e5dea02 100644 --- a/mecab/csharp/Node.cs +++ b/mecab/csharp/Node.cs @@ -1,46 +1,53 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - -public class Node : IDisposable { - private HandleRef swigCPtr; +public class Node : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal Node(IntPtr cPtr, bool cMemoryOwn) { + internal Node(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; - swigCPtr = new HandleRef(this, cPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Node obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~Node() { + Dispose(false); } - internal static HandleRef getCPtr(Node obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); } - public virtual void Dispose() { + protected virtual void Dispose(bool disposing) { lock(this) { - if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; - throw new MethodAccessException("C++ destructor does not have public access"); + throw new global::System.MethodAccessException("C++ destructor does not have public access"); } - swigCPtr = new HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - GC.SuppressFinalize(this); } } public Node prev { get { - IntPtr cPtr = MeCabPINVOKE.Node_prev_get(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Node_prev_get(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -48,8 +55,8 @@ public Node prev { public Node next { get { - IntPtr cPtr = MeCabPINVOKE.Node_next_get(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Node_next_get(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -57,8 +64,8 @@ public Node next { public Node enext { get { - IntPtr cPtr = MeCabPINVOKE.Node_enext_get(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Node_enext_get(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -66,8 +73,8 @@ public Node enext { public Node bnext { get { - IntPtr cPtr = MeCabPINVOKE.Node_bnext_get(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Node_bnext_get(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -75,8 +82,8 @@ public Node bnext { public Path rpath { get { - IntPtr cPtr = MeCabPINVOKE.Node_rpath_get(swigCPtr); - Path ret = (cPtr == IntPtr.Zero) ? null : new Path(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Node_rpath_get(swigCPtr); + Path ret = (cPtr == global::System.IntPtr.Zero) ? null : new Path(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -84,8 +91,8 @@ public Path rpath { public Path lpath { get { - IntPtr cPtr = MeCabPINVOKE.Node_lpath_get(swigCPtr); - Path ret = (cPtr == IntPtr.Zero) ? null : new Path(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Node_lpath_get(swigCPtr); + Path ret = (cPtr == global::System.IntPtr.Zero) ? null : new Path(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/mecab/csharp/Path.cs b/mecab/csharp/Path.cs index 41d8500..cce0cfc 100644 --- a/mecab/csharp/Path.cs +++ b/mecab/csharp/Path.cs @@ -1,46 +1,53 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - -public class Path : IDisposable { - private HandleRef swigCPtr; +public class Path : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal Path(IntPtr cPtr, bool cMemoryOwn) { + internal Path(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; - swigCPtr = new HandleRef(this, cPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Path obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~Path() { + Dispose(false); } - internal static HandleRef getCPtr(Path obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); } - public virtual void Dispose() { + protected virtual void Dispose(bool disposing) { lock(this) { - if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; - throw new MethodAccessException("C++ destructor does not have public access"); + throw new global::System.MethodAccessException("C++ destructor does not have public access"); } - swigCPtr = new HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - GC.SuppressFinalize(this); } } public Node rnode { get { - IntPtr cPtr = MeCabPINVOKE.Path_rnode_get(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Path_rnode_get(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -48,8 +55,8 @@ public Node rnode { public Path rnext { get { - IntPtr cPtr = MeCabPINVOKE.Path_rnext_get(swigCPtr); - Path ret = (cPtr == IntPtr.Zero) ? null : new Path(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Path_rnext_get(swigCPtr); + Path ret = (cPtr == global::System.IntPtr.Zero) ? null : new Path(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -57,8 +64,8 @@ public Path rnext { public Node lnode { get { - IntPtr cPtr = MeCabPINVOKE.Path_lnode_get(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Path_lnode_get(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -66,8 +73,8 @@ public Node lnode { public Path lnext { get { - IntPtr cPtr = MeCabPINVOKE.Path_lnext_get(swigCPtr); - Path ret = (cPtr == IntPtr.Zero) ? null : new Path(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Path_lnext_get(swigCPtr); + Path ret = (cPtr == global::System.IntPtr.Zero) ? null : new Path(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/mecab/csharp/Tagger.cs b/mecab/csharp/Tagger.cs index 0359857..ce68604 100644 --- a/mecab/csharp/Tagger.cs +++ b/mecab/csharp/Tagger.cs @@ -1,43 +1,46 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 4.0.2 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ namespace MeCab { -using System; -using System.Runtime.InteropServices; - -public class Tagger : IDisposable { - private HandleRef swigCPtr; +public class Tagger : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal Tagger(IntPtr cPtr, bool cMemoryOwn) { + internal Tagger(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; - swigCPtr = new HandleRef(this, cPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static HandleRef getCPtr(Tagger obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Tagger obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Tagger() { - Dispose(); + Dispose(false); + } + + public void Dispose() { + Dispose(true); + global::System.GC.SuppressFinalize(this); } - public virtual void Dispose() { + protected virtual void Dispose(bool disposing) { lock(this) { - if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; MeCabPINVOKE.delete_Tagger(swigCPtr); } - swigCPtr = new HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - GC.SuppressFinalize(this); } } @@ -60,8 +63,8 @@ public virtual string parse(string str) { } public virtual Node parseToNode(string str) { - IntPtr cPtr = MeCabPINVOKE.Tagger_parseToNode(swigCPtr, str); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Tagger_parseToNode(swigCPtr, str); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -79,8 +82,8 @@ public virtual bool parseNBestInit(string str) { } public virtual Node nextNode() { - IntPtr cPtr = MeCabPINVOKE.Tagger_nextNode(swigCPtr); - Node ret = (cPtr == IntPtr.Zero) ? null : new Node(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Tagger_nextNode(swigCPtr); + Node ret = (cPtr == global::System.IntPtr.Zero) ? null : new Node(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -153,8 +156,8 @@ public virtual float theta() { } public virtual DictionaryInfo dictionary_info() { - IntPtr cPtr = MeCabPINVOKE.Tagger_dictionary_info(swigCPtr); - DictionaryInfo ret = (cPtr == IntPtr.Zero) ? null : new DictionaryInfo(cPtr, false); + global::System.IntPtr cPtr = MeCabPINVOKE.Tagger_dictionary_info(swigCPtr); + DictionaryInfo ret = (cPtr == global::System.IntPtr.Zero) ? null : new DictionaryInfo(cPtr, false); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -165,20 +168,6 @@ public virtual string what() { return ret; } - public static Tagger create(int argc, SWIGTYPE_p_p_char argv) { - IntPtr cPtr = MeCabPINVOKE.Tagger_create__SWIG_0(argc, SWIGTYPE_p_p_char.getCPtr(argv)); - Tagger ret = (cPtr == IntPtr.Zero) ? null : new Tagger(cPtr, false); - if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static Tagger create(string arg) { - IntPtr cPtr = MeCabPINVOKE.Tagger_create__SWIG_1(arg); - Tagger ret = (cPtr == IntPtr.Zero) ? null : new Tagger(cPtr, false); - if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public static string version() { string ret = MeCabPINVOKE.Tagger_version(); if (MeCabPINVOKE.SWIGPendingException.Pending) throw MeCabPINVOKE.SWIGPendingException.Retrieve(); diff --git a/mecab/java/MeCab_wrap.cxx b/mecab/java/MeCab_wrap.cxx index b69a1cd..bb63fa2 100644 --- a/mecab/java/MeCab_wrap.cxx +++ b/mecab/java/MeCab_wrap.cxx @@ -1,14 +1,18 @@ /* ---------------------------------------------------------------------------- * 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 4.0.2 + * + * 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 SWIGJAVA #define SWIGJAVA +#endif + #ifdef __cplusplus @@ -65,28 +69,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 @@ -101,9 +105,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 @@ -129,7 +135,7 @@ template T SwigValueInit() { # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL -# endif +# endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ @@ -142,6 +148,19 @@ 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 /* Fix for jlong on some versions of gcc on Windows */ @@ -163,15 +182,16 @@ template T SwigValueInit() { /* Support for throwing Java exceptions */ typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, + SWIG_JavaOutOfMemoryError = 1, + SWIG_JavaIOException, + SWIG_JavaRuntimeException, SWIG_JavaIndexOutOfBoundsException, SWIG_JavaArithmeticException, SWIG_JavaIllegalArgumentException, SWIG_JavaNullPointerException, SWIG_JavaDirectorPureVirtual, - SWIG_JavaUnknownError + SWIG_JavaUnknownError, + SWIG_JavaIllegalStateException, } SWIG_JavaExceptionCodes; typedef struct { @@ -192,6 +212,7 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, { SWIG_JavaUnknownError, "java/lang/UnknownError" }, + { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" }, { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } }; const SWIG_JavaExceptions_t *except_ptr = java_exceptions; @@ -211,18 +232,18 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else /* 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 @@ -262,6 +283,7 @@ SWIGINTERN void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) { } +#include #include @@ -2661,69 +2683,6 @@ SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_delete_1Model(JNIEnv *jen } -SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1create_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { - jlong jresult = 0 ; - int arg1 ; - char **arg2 = (char **) 0 ; - MeCab::Model *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (int)jarg1; - arg2 = *(char ***)&jarg2; - { - try { - result = (MeCab::Model *)MeCab::Model::create(arg1,arg2); - } - catch (char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - *(MeCab::Model **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1create_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - MeCab::Model *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - { - try { - result = (MeCab::Model *)MeCab::Model::create((char const *)arg1); - } - catch (char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - *(MeCab::Model **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_new_1Model_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1) { jlong jresult = 0 ; char *arg1 = (char *) 0 ; @@ -3449,69 +3408,6 @@ SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_delete_1Tagger(JNIEnv *je } -SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1create_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { - jlong jresult = 0 ; - int arg1 ; - char **arg2 = (char **) 0 ; - MeCab::Tagger *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (int)jarg1; - arg2 = *(char ***)&jarg2; - { - try { - result = (MeCab::Tagger *)MeCab::Tagger::create(arg1,arg2); - } - catch (char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - *(MeCab::Tagger **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1create_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - MeCab::Tagger *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - { - try { - result = (MeCab::Tagger *)MeCab::Tagger::create((char const *)arg1); - } - catch (char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; - }; - } - catch (const char *e) { - { - SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; - }; - } - } - *(MeCab::Tagger **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1version(JNIEnv *jenv, jclass jcls) { jstring jresult = 0 ; char *result = 0 ; diff --git a/mecab/java/org/chasen/mecab/DictionaryInfo.java b/mecab/java/org/chasen/mecab/DictionaryInfo.java index ffa2f7d..5522231 100644 --- a/mecab/java/org/chasen/mecab/DictionaryInfo.java +++ b/mecab/java/org/chasen/mecab/DictionaryInfo.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -9,18 +9,19 @@ package org.chasen.mecab; public class DictionaryInfo { - private long swigCPtr; - protected boolean swigCMemOwn; + private transient long swigCPtr; + protected transient boolean swigCMemOwn; - public DictionaryInfo(long cPtr, boolean cMemoryOwn) { + protected DictionaryInfo(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } - public static long getCPtr(DictionaryInfo obj) { + protected static long getCPtr(DictionaryInfo obj) { return (obj == null) ? 0 : obj.swigCPtr; } + @SuppressWarnings("deprecation") protected void finalize() { delete(); } diff --git a/mecab/java/org/chasen/mecab/Lattice.java b/mecab/java/org/chasen/mecab/Lattice.java index 78eac01..20b8a95 100644 --- a/mecab/java/org/chasen/mecab/Lattice.java +++ b/mecab/java/org/chasen/mecab/Lattice.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -9,18 +9,19 @@ package org.chasen.mecab; public class Lattice { - private long swigCPtr; - protected boolean swigCMemOwn; + private transient long swigCPtr; + protected transient boolean swigCMemOwn; - public Lattice(long cPtr, boolean cMemoryOwn) { + protected Lattice(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } - public static long getCPtr(Lattice obj) { + protected static long getCPtr(Lattice obj) { return (obj == null) ? 0 : obj.swigCPtr; } + @SuppressWarnings("deprecation") protected void finalize() { delete(); } diff --git a/mecab/java/org/chasen/mecab/MeCab.java b/mecab/java/org/chasen/mecab/MeCab.java index 160c000..3b9ffb2 100644 --- a/mecab/java/org/chasen/mecab/MeCab.java +++ b/mecab/java/org/chasen/mecab/MeCab.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/mecab/java/org/chasen/mecab/MeCabConstants.java b/mecab/java/org/chasen/mecab/MeCabConstants.java index 4108707..8df8746 100644 --- a/mecab/java/org/chasen/mecab/MeCabConstants.java +++ b/mecab/java/org/chasen/mecab/MeCabConstants.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/mecab/java/org/chasen/mecab/MeCabJNI.java b/mecab/java/org/chasen/mecab/MeCabJNI.java index a600a64..ff4a03c 100644 --- a/mecab/java/org/chasen/mecab/MeCabJNI.java +++ b/mecab/java/org/chasen/mecab/MeCabJNI.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -108,8 +108,6 @@ public class MeCabJNI { public final static native boolean Model_swap(long jarg1, Model jarg1_, long jarg2, Model jarg2_); public final static native String Model_version(); public final static native void delete_Model(long jarg1); - public final static native long Model_create__SWIG_0(int jarg1, long jarg2); - public final static native long Model_create__SWIG_1(String jarg1); public final static native long new_Model__SWIG_0(String jarg1); public final static native long new_Model__SWIG_1(); public final static native boolean Tagger_parse__SWIG_0(long jarg1, Model jarg1_, long jarg2, Lattice jarg2_); @@ -134,8 +132,6 @@ public class MeCabJNI { public final static native long Tagger_dictionary_info(long jarg1, Tagger jarg1_); public final static native String Tagger_what(long jarg1, Tagger jarg1_); public final static native void delete_Tagger(long jarg1); - public final static native long Tagger_create__SWIG_0(int jarg1, long jarg2); - public final static native long Tagger_create__SWIG_1(String jarg1); public final static native String Tagger_version(); public final static native long new_Tagger__SWIG_0(String jarg1); public final static native long new_Tagger__SWIG_1(); diff --git a/mecab/java/org/chasen/mecab/Model.java b/mecab/java/org/chasen/mecab/Model.java index 28a06bb..40b09b7 100644 --- a/mecab/java/org/chasen/mecab/Model.java +++ b/mecab/java/org/chasen/mecab/Model.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -9,18 +9,19 @@ package org.chasen.mecab; public class Model { - private long swigCPtr; - protected boolean swigCMemOwn; + private transient long swigCPtr; + protected transient boolean swigCMemOwn; - public Model(long cPtr, boolean cMemoryOwn) { + protected Model(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } - public static long getCPtr(Model obj) { + protected static long getCPtr(Model obj) { return (obj == null) ? 0 : obj.swigCPtr; } + @SuppressWarnings("deprecation") protected void finalize() { delete(); } @@ -51,12 +52,12 @@ public Node lookup(String begin, String end, Lattice lattice) { public Tagger createTagger() { long cPtr = MeCabJNI.Model_createTagger(swigCPtr, this); - return (cPtr == 0) ? null : new Tagger(cPtr, false); + return (cPtr == 0) ? null : new Tagger(cPtr, true); } public Lattice createLattice() { long cPtr = MeCabJNI.Model_createLattice(swigCPtr, this); - return (cPtr == 0) ? null : new Lattice(cPtr, false); + return (cPtr == 0) ? null : new Lattice(cPtr, true); } public boolean swap(Model model) { @@ -67,16 +68,6 @@ public static String version() { return MeCabJNI.Model_version(); } - public static Model create(int argc, SWIGTYPE_p_p_char argv) { - long cPtr = MeCabJNI.Model_create__SWIG_0(argc, SWIGTYPE_p_p_char.getCPtr(argv)); - return (cPtr == 0) ? null : new Model(cPtr, false); - } - - public static Model create(String arg) { - long cPtr = MeCabJNI.Model_create__SWIG_1(arg); - return (cPtr == 0) ? null : new Model(cPtr, false); - } - public Model(String argc) { this(MeCabJNI.new_Model__SWIG_0(argc), true); } diff --git a/mecab/java/org/chasen/mecab/Node.java b/mecab/java/org/chasen/mecab/Node.java index 5c8fe12..db3ee4d 100644 --- a/mecab/java/org/chasen/mecab/Node.java +++ b/mecab/java/org/chasen/mecab/Node.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -9,15 +9,15 @@ package org.chasen.mecab; public class Node { - private long swigCPtr; - protected boolean swigCMemOwn; + private transient long swigCPtr; + protected transient boolean swigCMemOwn; - public Node(long cPtr, boolean cMemoryOwn) { + protected Node(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } - public static long getCPtr(Node obj) { + protected static long getCPtr(Node obj) { return (obj == null) ? 0 : obj.swigCPtr; } diff --git a/mecab/java/org/chasen/mecab/Path.java b/mecab/java/org/chasen/mecab/Path.java index a89e63a..9b5120b 100644 --- a/mecab/java/org/chasen/mecab/Path.java +++ b/mecab/java/org/chasen/mecab/Path.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -9,15 +9,15 @@ package org.chasen.mecab; public class Path { - private long swigCPtr; - protected boolean swigCMemOwn; + private transient long swigCPtr; + protected transient boolean swigCMemOwn; - public Path(long cPtr, boolean cMemoryOwn) { + protected Path(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } - public static long getCPtr(Path obj) { + protected static long getCPtr(Path obj) { return (obj == null) ? 0 : obj.swigCPtr; } diff --git a/mecab/java/org/chasen/mecab/Tagger.java b/mecab/java/org/chasen/mecab/Tagger.java index a9ab50b..3344946 100644 --- a/mecab/java/org/chasen/mecab/Tagger.java +++ b/mecab/java/org/chasen/mecab/Tagger.java @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.4 + * Version 4.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -9,18 +9,19 @@ package org.chasen.mecab; public class Tagger { - private long swigCPtr; - protected boolean swigCMemOwn; + private transient long swigCPtr; + protected transient boolean swigCMemOwn; - public Tagger(long cPtr, boolean cMemoryOwn) { + protected Tagger(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } - public static long getCPtr(Tagger obj) { + protected static long getCPtr(Tagger obj) { return (obj == null) ? 0 : obj.swigCPtr; } + @SuppressWarnings("deprecation") protected void finalize() { delete(); } @@ -122,16 +123,6 @@ public String what() { return MeCabJNI.Tagger_what(swigCPtr, this); } - public static Tagger create(int argc, SWIGTYPE_p_p_char argv) { - long cPtr = MeCabJNI.Tagger_create__SWIG_0(argc, SWIGTYPE_p_p_char.getCPtr(argv)); - return (cPtr == 0) ? null : new Tagger(cPtr, false); - } - - public static Tagger create(String arg) { - long cPtr = MeCabJNI.Tagger_create__SWIG_1(arg); - return (cPtr == 0) ? null : new Tagger(cPtr, false); - } - public static String version() { return MeCabJNI.Tagger_version(); } diff --git a/mecab/perl/MeCab.pm b/mecab/perl/MeCab.pm index 85431af..13c8238 100644 --- a/mecab/perl/MeCab.pm +++ b/mecab/perl/MeCab.pm @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 2.0.4 +# Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. @@ -291,7 +291,6 @@ sub DESTROY { } } -*create = *MeCabc::Model_create; sub new { my $pkg = shift; my $self = MeCabc::new_Model(@_); @@ -348,7 +347,6 @@ sub DESTROY { } } -*create = *MeCabc::Tagger_create; *version = *MeCabc::Tagger_version; sub new { my $pkg = shift; diff --git a/mecab/perl/MeCab_wrap.cxx b/mecab/perl/MeCab_wrap.cxx index 68981eb..8a6ea45 100644 --- a/mecab/perl/MeCab_wrap.cxx +++ b/mecab/perl/MeCab_wrap.cxx @@ -1,14 +1,18 @@ /* ---------------------------------------------------------------------------- * 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 4.0.2 + * + * 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 SWIGPERL #define SWIGPERL +#endif + #define SWIG_CASTRANK_MODE @@ -66,28 +70,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 +106,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 +136,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,6 +149,19 @@ 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 /* ----------------------------------------------------------------------------- * swigrun.swg @@ -168,7 +187,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. */ @@ -189,21 +208,22 @@ template T SwigValueInit() { /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 /* Flags for new pointer objects */ #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) { @@ -236,23 +256,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 @@ -266,17 +286,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) @@ -307,14 +327,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 @@ -358,7 +378,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. @@ -378,18 +398,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; @@ -397,24 +417,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 */ @@ -442,7 +451,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 * @@ -477,7 +486,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 * @@ -521,7 +530,7 @@ SWIG_TypePrettyName(const swig_type_info *type) { return type->name; } -/* +/* Set the clientdata field for a type */ SWIGRUNTIME void @@ -529,14 +538,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; } } @@ -545,31 +554,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) { @@ -594,14 +603,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); @@ -612,7 +621,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]; @@ -620,56 +629,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 * @@ -729,18 +738,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 @@ -854,50 +863,35 @@ extern "C" { SWIGINTERN const char* SWIG_Perl_ErrorType(int code) { - const char* type = 0; switch(code) { case SWIG_MemoryError: - type = "MemoryError"; - break; + return "MemoryError"; case SWIG_IOError: - type = "IOError"; - break; + return "IOError"; case SWIG_RuntimeError: - type = "RuntimeError"; - break; + return "RuntimeError"; case SWIG_IndexError: - type = "IndexError"; - break; + return "IndexError"; case SWIG_TypeError: - type = "TypeError"; - break; + return "TypeError"; case SWIG_DivisionByZero: - type = "ZeroDivisionError"; - break; + return "ZeroDivisionError"; case SWIG_OverflowError: - type = "OverflowError"; - break; + return "OverflowError"; case SWIG_SyntaxError: - type = "SyntaxError"; - break; + return "SyntaxError"; case SWIG_ValueError: - type = "ValueError"; - break; + return "ValueError"; case SWIG_SystemError: - type = "SystemError"; - break; + return "SystemError"; case SWIG_AttributeError: - type = "AttributeError"; - break; + return "AttributeError"; default: - type = "RuntimeError"; + return "RuntimeError"; } - return type; } - - /* ----------------------------------------------------------------------------- * perlrun.swg * @@ -920,6 +914,8 @@ SWIG_Perl_ErrorType(int code) { #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) #define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own) #define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) +#define SWIG_AcquirePtr(ptr, src) SWIG_Perl_AcquirePtr(ptr, src) +#define swig_owntype int /* for raw packed data */ #define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) @@ -940,14 +936,14 @@ SWIG_Perl_ErrorType(int code) { /* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() +#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) /* Error manipulation */ #define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) -#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg) +#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg) #define SWIG_fail goto fail /* Perl-specific SWIG API */ @@ -1041,26 +1037,23 @@ typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); #endif /* MULTIPLICITY */ #endif /* PERL_OBJECT */ -/* Workaround for bug in perl 5.6.x croak and earlier */ -#if (PERL_VERSION < 8) # ifdef PERL_OBJECT # define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) -static void SWIG_Perl_croak_null(CPerlObj *pPerl) +static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl) # else -static void SWIG_croak_null() +static void SWIGUNUSED SWIG_croak_null() # endif { - SV *err=ERRSV; + SV *err = get_sv("@", GV_ADD); # if (PERL_VERSION < 6) croak("%_", err); # else - if (SvOK(err) && !SvROK(err)) croak("%_", err); - croak(Nullch); + if (sv_isobject(err)) + croak(0); + else + croak("%s", SvPV_nolen(err)); # endif } -#else -# define SWIG_croak_null() croak(Nullch) -#endif /* @@ -1112,8 +1105,7 @@ SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { - if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || - (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) { + if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ @@ -1132,6 +1124,14 @@ SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { return 0; } +/* Acquire a pointer value */ + +SWIGRUNTIME int +SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) { + /* TODO */ + return 0; +} + /* Function for getting a pointer value */ SWIGRUNTIME int @@ -1171,7 +1171,7 @@ SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_ voidptr = INT2PTR(void *,tmp); } else if (! SvOK(sv)) { /* Check for undef */ *(ptr) = (void *) 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ if (!SvROK(sv)) { /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ @@ -1192,7 +1192,11 @@ SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_ /* Now see if the types match */ char *_c = HvNAME(SvSTASH(SvRV(sv))); tc = SWIG_TypeProxyCheck(_c,_t); +#ifdef SWIG_DIRECTORS + if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) { +#else if (!tc) { +#endif return SWIG_ERROR; } { @@ -1244,7 +1248,7 @@ SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, i SV *obj=newSV(0); HV *hash=newHV(); HV *stash; - sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr); + sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr); stash=SvSTASH(SvRV(obj)); if (flags & SWIG_POINTER_OWN) { HV *hv; @@ -1262,7 +1266,7 @@ SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, i sv_bless(sv, stash); } else { - sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr); + sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr); } } @@ -1291,7 +1295,7 @@ SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info return result; } -/* Convert a packed value value */ +/* Convert a packed pointer value */ SWIGRUNTIME int SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { swig_cast_info *tc; @@ -1353,19 +1357,23 @@ typedef struct { /* Magic variable code */ #ifndef PERL_OBJECT -#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) - #ifndef MULTIPLICITY - SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) - #else - SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) - #endif +# ifdef __cplusplus +# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast(a),b,c) +# else +# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c) +# endif +# ifndef MULTIPLICITY +SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) +# else +SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) +# endif #else # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) #endif { MAGIC *mg; - sv_magic(sv,sv,'U',(char *) name,strlen(name)); + sv_magic(sv,sv,'U',name,strlen(name)); mg = mg_find(sv,'U'); mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); mg->mg_virtual->svt_get = (SwigMagicFunc) get; @@ -1377,7 +1385,7 @@ SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, i SWIGRUNTIME swig_module_info * -SWIG_Perl_GetModule(void) { +SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) { static void *type_pointer = (void *)0; SV *pointer; @@ -1471,9 +1479,6 @@ SWIG_Perl_SetModule(swig_module_info *module) { #ifdef eof #undef eof #endif -#ifdef bool - #undef bool -#endif #ifdef close #undef close #endif @@ -1513,6 +1518,17 @@ SWIG_Perl_SetModule(swig_module_info *module) { #ifdef stat #undef stat #endif +#ifdef seed + #undef seed +#endif + +#ifdef bool + /* Leave if macro is from C99 stdbool.h */ + #ifndef __bool_true_false_are_defined + #undef bool + #endif +#endif + @@ -1535,9 +1551,8 @@ SWIG_Perl_SetModule(swig_module_info *module) { #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) @@ -1548,7 +1563,7 @@ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; #define SWIG_name "MeCabc::boot_MeCab" #define SWIG_prefix "MeCabc::" -#define SWIGVERSION 0x020004 +#define SWIGVERSION 0x040002 #define SWIG_VERSION SWIGVERSION @@ -1665,43 +1680,15 @@ SWIG_FromCharPtr(const char *cptr) } -SWIGINTERN int -SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) -{ - if (SvNIOK(obj)) { - if (val) *val = SvNV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - if (val) *val = (double) SvIV(obj); - return SWIG_AddCast(SWIG_OK); - } else { - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - double v; - errno = 0; - v = strtod(nptr, &endptr); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - } - return SWIG_TypeError; -} - - SWIGINTERNINLINE SV * SWIG_From_unsigned_SS_long SWIG_PERL_DECL_ARGS_1(unsigned long value) -{ - SV *obj = sv_newmortal(); - sv_setuv(obj, (UV) value); - return obj; +{ + SV *sv; + if (UVSIZE >= sizeof(value) || value <= UV_MAX) + sv = newSVuv(value); + else + sv = newSVpvf("%lu", value); + return sv_2mortal(sv); } @@ -1714,10 +1701,13 @@ SWIG_From_unsigned_SS_int SWIG_PERL_DECL_ARGS_1(unsigned int value) SWIGINTERNINLINE SV * SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) -{ - SV *obj = sv_newmortal(); - sv_setiv(obj, (IV) value); - return obj; +{ + SV *sv; + if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) + sv = newSViv(value); + else + sv = newSVpvf("%ld", value); + return sv_2mortal(sv); } @@ -1738,13 +1728,91 @@ SWIG_From_unsigned_SS_short SWIG_PERL_DECL_ARGS_1(unsigned short 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(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# elif defined(__clang__) && defined(__has_builtin) +# if __has_builtin(__builtin_isfinite) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# endif +# 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 +SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) +{ + if (SvNIOK(obj)) { + if (val) *val = SvNV(obj); + return SWIG_OK; + } else if (SvIOK(obj)) { + if (val) *val = (double) SvIV(obj); + return SWIG_AddCast(SWIG_OK); + } else { + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + double v; + errno = 0; + v = strtod(nptr, &endptr); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + } + return SWIG_TypeError; +} + + SWIGINTERN int SWIG_AsVal_float SWIG_PERL_DECL_ARGS_2(SV * obj, float *val) { double v; int res = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(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); @@ -1756,10 +1824,8 @@ SWIG_AsVal_float SWIG_PERL_DECL_ARGS_2(SV * obj, float *val) SWIGINTERNINLINE SV * SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value) -{ - SV *obj = sv_newmortal(); - sv_setnv(obj, value); - return obj; +{ + return sv_2mortal(newSVnv(value)); } @@ -1786,18 +1852,30 @@ SWIG_From_short SWIG_PERL_DECL_ARGS_1(short value) SWIGINTERNINLINE SV * SWIG_From_bool SWIG_PERL_DECL_ARGS_1(bool value) -{ - SV *obj = sv_newmortal(); - if (value) { - sv_setsv(obj, &PL_sv_yes); - } else { - sv_setsv(obj, &PL_sv_no); - } - return obj; +{ + return boolSV(value); } -#include +#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 + + +#include +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif SWIGINTERNINLINE int @@ -1835,20 +1913,18 @@ SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) { if (SvUOK(obj)) { UV v = SvUV(obj); - if (v >= 0 && v <= ULONG_MAX) { + if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) { if (val) *val = v; return SWIG_OK; - } else { - return SWIG_OverflowError; } - } else if (SvIOK(obj)) { + return SWIG_OverflowError; + } else if (SvIOK(obj)) { IV v = SvIV(obj); - if (v >= 0 && v <= ULONG_MAX) { + if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) { if (val) *val = v; return SWIG_OK; - } else { - return SWIG_OverflowError; } + return SWIG_OverflowError; } else { int dispatch = 0; const char *nptr = SvPV_nolen(obj); @@ -1880,44 +1956,141 @@ SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) } +#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 SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long long *val) +{ + if (SvUOK(obj)) { + /* pretty sure this should be conditional on + * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */ + if (val) *val = SvUV(obj); + return SWIG_OK; + } else if (SvIOK(obj)) { + IV v = SvIV(obj); + if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) { + if (val) *val = v; + return SWIG_OK; + } else { + return SWIG_OverflowError; + } + } else { + int dispatch = 0; + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + unsigned long long v; + errno = 0; + v = strtoull(nptr, &endptr,0); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + if (!dispatch) { + const double mant_max = 1LL << DBL_MANT_DIG; + double d; + int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { + if (val) *val = (unsigned long long)(d); + return res; + } + } + } + return SWIG_TypeError; +} +#endif + + SWIGINTERNINLINE int SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val) { - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(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 SWIG_PERL_CALL_ARGS_2(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 SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); + } +#endif return res; } +#include +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__BORLANDC__) || defined(_WATCOM) +# ifndef snprintf +# define snprintf _snprintf +# endif +#endif + + +#ifdef SWIG_LONG_LONG_AVAILABLE SWIGINTERNINLINE SV * -SWIG_From_size_t SWIG_PERL_DECL_ARGS_1(size_t value) -{ - return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long >(value)); +SWIG_From_unsigned_SS_long_SS_long SWIG_PERL_DECL_ARGS_1(unsigned long long value) +{ + SV *sv; + if (UVSIZE >= sizeof(value) || value <= UV_MAX) + sv = newSVuv((UV)(value)); + else { + //sv = newSVpvf("%llu", value); doesn't work in non 64bit Perl + char temp[256]; + sprintf(temp, "%llu", value); + sv = newSVpv(temp, 0); + } + return sv_2mortal(sv); } +#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 SV * +SWIG_From_size_t SWIG_PERL_DECL_ARGS_1(size_t value) +{ +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(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 SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long long >(value)); + } #endif +} SWIGINTERN int SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) { - if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= LONG_MIN && v <= LONG_MAX) { + if (SvUOK(obj)) { + UV v = SvUV(obj); + if (UVSIZE < sizeof(*val) || v <= LONG_MAX) { if (val) *val = v; return SWIG_OK; - } else { - return SWIG_OverflowError; } + return SWIG_OverflowError; + } else if (SvIOK(obj)) { + IV v = SvIV(obj); + if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) { + if(val) *val = v; + return SWIG_OK; + } + return SWIG_OverflowError; } else { int dispatch = 0; const char *nptr = SvPV_nolen(obj); @@ -1993,7 +2166,7 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) if (cptr) { if (alloc) { if (*alloc == SWIG_NEWOBJ) { - *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); + *cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size))); } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; @@ -2051,10 +2224,9 @@ SWIG_AsVal_bool SWIG_PERL_DECL_ARGS_2(SV *obj, bool* val) if (val) *val = false; return SWIG_OK; } else { - if (val) *val = SvTRUE(obj) ? true: false; + if (val) *val = SvTRUE(obj) ? true : false; return SWIG_AddCast(SWIG_OK); } - return SWIG_TypeError; } SWIGINTERN char const *MeCab_Tagger_parseToString__SWIG_0(MeCab::Tagger *self,char const *str,size_t length=0){ @@ -2368,7 +2540,7 @@ XS(_wrap_delete_DictionaryInfo) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); fail: @@ -2543,7 +2715,7 @@ XS(_wrap_Path_prob_set) { } arg2 = static_cast< float >(val2); if (arg1) (arg1)->prob = arg2; - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -3112,7 +3284,7 @@ XS(_wrap_Node_prob_set) { } arg2 = static_cast< float >(val2); if (arg1) (arg1)->prob = arg2; - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -3274,7 +3446,7 @@ XS(_wrap_Lattice_clear) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); fail: @@ -3605,7 +3777,7 @@ XS(_wrap_Lattice_set_Z) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -3690,7 +3862,7 @@ XS(_wrap_Lattice_set_theta) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -3899,7 +4071,7 @@ XS(_wrap_Lattice_set_request_type) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -3946,7 +4118,7 @@ XS(_wrap_Lattice_add_request_type) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -3993,7 +4165,7 @@ XS(_wrap_Lattice_remove_request_type) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -4189,9 +4361,9 @@ XS(_wrap_Lattice_toString) { dispatch: switch(_index) { case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Lattice_toString__SWIG_0); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_Lattice_toString__SWIG_0); return; case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Lattice_toString__SWIG_1); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_Lattice_toString__SWIG_1); return; } } @@ -4425,7 +4597,7 @@ XS(_wrap_Lattice_set_boundary_constraint) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; @@ -4491,7 +4663,7 @@ XS(_wrap_Lattice_set_feature_constraint) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; @@ -4543,7 +4715,7 @@ XS(_wrap_Lattice_set_result) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; if (alloc2 == SWIG_NEWOBJ) delete[] buf2; XSRETURN(argvi); @@ -4629,7 +4801,7 @@ XS(_wrap_Lattice_set_what) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; if (alloc2 == SWIG_NEWOBJ) delete[] buf2; XSRETURN(argvi); @@ -4668,7 +4840,7 @@ XS(_wrap_delete_Lattice) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); fail: @@ -4742,7 +4914,7 @@ XS(_wrap_Lattice_set_sentence) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; if (alloc2 == SWIG_NEWOBJ) delete[] buf2; XSRETURN(argvi); @@ -4948,7 +5120,7 @@ XS(_wrap_Model_createTagger) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | SWIG_SHADOW); argvi++ ; + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, SWIG_OWNER | SWIG_SHADOW); argvi++ ; XSRETURN(argvi); fail: @@ -4977,120 +5149,7 @@ XS(_wrap_Model_createLattice) { arg1 = reinterpret_cast< MeCab::Model * >(argp1); { try { - result = (MeCab::Lattice *)((MeCab::Model const *)arg1)->createLattice(); - } - catch (char *e) { - SWIG_exception (SWIG_RuntimeError, e); - } - catch (const char *e) { - SWIG_exception (SWIG_RuntimeError, (char*)e); - } - } - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, 0 | SWIG_SHADOW); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_Model_swap) { - { - MeCab::Model *arg1 = (MeCab::Model *) 0 ; - MeCab::Model *arg2 = (MeCab::Model *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int argvi = 0; - bool result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Model_swap(self,model);"); - } - res1 = SWIG_ConvertPtr(ST(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(ST(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 *""'"); - } - arg2 = reinterpret_cast< MeCab::Model * >(argp2); - { - try { - result = (bool)(arg1)->swap(arg2); - } - catch (char *e) { - SWIG_exception (SWIG_RuntimeError, e); - } - catch (const char *e) { - SWIG_exception (SWIG_RuntimeError, (char*)e); - } - } - ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_Model_version) { - { - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: Model_version();"); - } - { - try { - result = (char *)MeCab::Model::version(); - } - catch (char *e) { - SWIG_exception (SWIG_RuntimeError, e); - } - catch (const char *e) { - SWIG_exception (SWIG_RuntimeError, (char*)e); - } - } - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_delete_Model) { - { - MeCab::Model *arg1 = (MeCab::Model *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: delete_Model(self);"); - } - res1 = SWIG_ConvertPtr(ST(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 *""'"); - } - arg1 = reinterpret_cast< MeCab::Model * >(argp1); - { - try { - delete arg1; + result = (MeCab::Lattice *)((MeCab::Model const *)arg1)->createLattice(); } catch (char *e) { SWIG_exception (SWIG_RuntimeError, e); @@ -5099,7 +5158,7 @@ XS(_wrap_delete_Model) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, SWIG_OWNER | SWIG_SHADOW); argvi++ ; XSRETURN(argvi); fail: @@ -5109,34 +5168,34 @@ XS(_wrap_delete_Model) { } -XS(_wrap_Model_create__SWIG_0) { +XS(_wrap_Model_swap) { { - int arg1 ; - char **arg2 = (char **) 0 ; - int val1 ; - int ecode1 = 0 ; + MeCab::Model *arg1 = (MeCab::Model *) 0 ; + MeCab::Model *arg2 = (MeCab::Model *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int argvi = 0; - MeCab::Model *result = 0 ; + bool result; dXSARGS; if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Model_create(argc,argv);"); + SWIG_croak("Usage: Model_swap(self,model);"); } - ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &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(ST(1), &argp2,SWIGTYPE_p_p_char, 0 | 0 ); + res1 = SWIG_ConvertPtr(ST(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(ST(1), &argp2,SWIGTYPE_p_MeCab__Model, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_create" "', argument " "2"" of type '" "char **""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_swap" "', argument " "2"" of type '" "MeCab::Model *""'"); } - arg2 = reinterpret_cast< char ** >(argp2); + arg2 = reinterpret_cast< MeCab::Model * >(argp2); { try { - result = (MeCab::Model *)MeCab::Model::create(arg1,arg2); + result = (bool)(arg1)->swap(arg2); } catch (char *e) { SWIG_exception (SWIG_RuntimeError, e); @@ -5145,7 +5204,7 @@ XS(_wrap_Model_create__SWIG_0) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | SWIG_SHADOW); argvi++ ; + ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ; XSRETURN(argvi); @@ -5157,27 +5216,18 @@ XS(_wrap_Model_create__SWIG_0) { } -XS(_wrap_Model_create__SWIG_1) { +XS(_wrap_Model_version) { { - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; int argvi = 0; - MeCab::Model *result = 0 ; + char *result = 0 ; dXSARGS; - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Model_create(arg);"); - } - res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_create" "', argument " "1"" of type '" "char const *""'"); + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: Model_version();"); } - arg1 = reinterpret_cast< char * >(buf1); { try { - result = (MeCab::Model *)MeCab::Model::create((char const *)arg1); + result = (char *)MeCab::Model::version(); } catch (char *e) { SWIG_exception (SWIG_RuntimeError, e); @@ -5186,84 +5236,48 @@ XS(_wrap_Model_create__SWIG_1) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | SWIG_SHADOW); argvi++ ; - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; SWIG_croak_null(); } } -XS(_wrap_Model_create) { - dXSARGS; - +XS(_wrap_delete_Model) { { - unsigned long _index = 0; - SWIG_TypeRank _rank = 0; - if (items == 1) { - SWIG_TypeRank _ranki = 0; - SWIG_TypeRank _rankm = 0; - SWIG_TypeRank _pi = 1; - int _v = 0; - { - int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0); - _v = SWIG_CheckState(res); - } - if (!_v) goto check_1; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - if (!_index || (_ranki < _rank)) { - _rank = _ranki; _index = 1; - if (_rank == _rankm) goto dispatch; - } - } - check_1: + MeCab::Model *arg1 = (MeCab::Model *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; - if (items == 2) { - SWIG_TypeRank _ranki = 0; - SWIG_TypeRank _rankm = 0; - SWIG_TypeRank _pi = 1; - int _v = 0; - { - { - int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), NULL); - _v = SWIG_CheckState(res); - } + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: delete_Model(self);"); + } + res1 = SWIG_ConvertPtr(ST(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 *""'"); + } + arg1 = reinterpret_cast< MeCab::Model * >(argp1); + { + try { + delete arg1; } - if (!_v) goto check_2; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - { - void *vptr = 0; - int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_p_char, 0); - _v = SWIG_CheckState(res); + catch (char *e) { + SWIG_exception (SWIG_RuntimeError, e); } - if (!_v) goto check_2; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - if (!_index || (_ranki < _rank)) { - _rank = _ranki; _index = 2; - if (_rank == _rankm) goto dispatch; + catch (const char *e) { + SWIG_exception (SWIG_RuntimeError, (char*)e); } } - check_2: + ST(argvi) = &PL_sv_undef; - dispatch: - switch(_index) { - case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Model_create__SWIG_1); return; - case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Model_create__SWIG_0); return; - } + XSRETURN(argvi); + fail: + + SWIG_croak_null(); } - - croak("No matching function for overloaded 'Model_create'"); - XSRETURN(0); } @@ -5371,9 +5385,9 @@ XS(_wrap_new_Model) { dispatch: switch(_index) { case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Model__SWIG_1); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Model__SWIG_1); return; case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Model__SWIG_0); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Model__SWIG_0); return; } } @@ -5543,7 +5557,7 @@ XS(_wrap_Tagger_parse) { int _v = 0; { void *vptr = 0; - int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Model, 0); + int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Model, SWIG_POINTER_NO_NULL); _v = SWIG_CheckState(res); } if (!_v) goto check_1; @@ -5628,11 +5642,11 @@ XS(_wrap_Tagger_parse) { dispatch: switch(_index) { case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parse__SWIG_0); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_Tagger_parse__SWIG_0); return; case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parse__SWIG_1); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_Tagger_parse__SWIG_1); return; case 3: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parse__SWIG_2); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_Tagger_parse__SWIG_2); return; } } @@ -5957,7 +5971,7 @@ XS(_wrap_Tagger_set_request_type) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -6080,7 +6094,7 @@ XS(_wrap_Tagger_set_partial) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -6165,7 +6179,7 @@ XS(_wrap_Tagger_set_lattice_level) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -6250,7 +6264,7 @@ XS(_wrap_Tagger_set_all_morphs) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -6297,7 +6311,7 @@ XS(_wrap_Tagger_set_theta) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); @@ -6450,174 +6464,16 @@ XS(_wrap_delete_Tagger) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - ST(argvi) = sv_newmortal(); - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_Tagger_create__SWIG_0) { - { - int arg1 ; - char **arg2 = (char **) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int argvi = 0; - MeCab::Tagger *result = 0 ; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Tagger_create(argc,argv);"); - } - ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &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(ST(1), &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); - } - } - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | SWIG_SHADOW); argvi++ ; - + ST(argvi) = &PL_sv_undef; XSRETURN(argvi); fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_Tagger_create__SWIG_1) { - { - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int argvi = 0; - MeCab::Tagger *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Tagger_create(arg);"); - } - res1 = SWIG_AsCharPtrAndSize(ST(0), &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); - } - } - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | SWIG_SHADOW); argvi++ ; - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - XSRETURN(argvi); - fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; SWIG_croak_null(); } } -XS(_wrap_Tagger_create) { - dXSARGS; - - { - unsigned long _index = 0; - SWIG_TypeRank _rank = 0; - if (items == 1) { - SWIG_TypeRank _ranki = 0; - SWIG_TypeRank _rankm = 0; - SWIG_TypeRank _pi = 1; - int _v = 0; - { - int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0); - _v = SWIG_CheckState(res); - } - if (!_v) goto check_1; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - if (!_index || (_ranki < _rank)) { - _rank = _ranki; _index = 1; - if (_rank == _rankm) goto dispatch; - } - } - check_1: - - if (items == 2) { - SWIG_TypeRank _ranki = 0; - SWIG_TypeRank _rankm = 0; - SWIG_TypeRank _pi = 1; - int _v = 0; - { - { - int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), NULL); - _v = SWIG_CheckState(res); - } - } - if (!_v) goto check_2; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - { - void *vptr = 0; - int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_p_char, 0); - _v = SWIG_CheckState(res); - } - if (!_v) goto check_2; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - if (!_index || (_ranki < _rank)) { - _rank = _ranki; _index = 2; - if (_rank == _rankm) goto dispatch; - } - } - check_2: - - dispatch: - switch(_index) { - case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_create__SWIG_1); return; - case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_create__SWIG_0); return; - } - } - - croak("No matching function for overloaded 'Tagger_create'"); - XSRETURN(0); -} - - XS(_wrap_Tagger_version) { { int argvi = 0; @@ -6750,9 +6606,9 @@ XS(_wrap_new_Tagger) { dispatch: switch(_index) { case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Tagger__SWIG_1); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Tagger__SWIG_1); return; case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Tagger__SWIG_0); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_new_Tagger__SWIG_0); return; } } @@ -6946,9 +6802,9 @@ XS(_wrap_Tagger_parseToString) { dispatch: switch(_index) { case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parseToString__SWIG_1); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_Tagger_parseToString__SWIG_1); return; case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parseToString__SWIG_0); return; + PUSHMARK(MARK); SWIG_CALLXS(_wrap_Tagger_parseToString__SWIG_0); return; } } @@ -6968,7 +6824,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*)"MeCab::Node", 0}; static swig_type_info _swigt__p_mecab_path_t = {"_p_mecab_path_t", "mecab_path_t *|MeCab::Path *", 0, 0, (void*)"MeCab::Path", 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, @@ -6979,7 +6834,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}}; @@ -6990,7 +6844,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, @@ -7001,7 +6854,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, }; @@ -7097,7 +6949,6 @@ static swig_command_info swig_commands[] = { {"MeCabc::Model_swap", _wrap_Model_swap}, {"MeCabc::Model_version", _wrap_Model_version}, {"MeCabc::delete_Model", _wrap_delete_Model}, -{"MeCabc::Model_create", _wrap_Model_create}, {"MeCabc::new_Model", _wrap_new_Model}, {"MeCabc::Tagger_parse", _wrap_Tagger_parse}, {"MeCabc::Tagger_parseToNode", _wrap_Tagger_parseToNode}, @@ -7119,7 +6970,6 @@ static swig_command_info swig_commands[] = { {"MeCabc::Tagger_dictionary_info", _wrap_Tagger_dictionary_info}, {"MeCabc::Tagger_what", _wrap_Tagger_what}, {"MeCabc::delete_Tagger", _wrap_delete_Tagger}, -{"MeCabc::Tagger_create", _wrap_Tagger_create}, {"MeCabc::Tagger_version", _wrap_Tagger_version}, {"MeCabc::new_Tagger", _wrap_new_Tagger}, {"MeCabc::Tagger_parseToString", _wrap_Tagger_parseToString}, @@ -7127,18 +6977,18 @@ static swig_command_info swig_commands[] = { }; /* ----------------------------------------------------------------------------- * 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 @@ -7148,17 +6998,17 @@ static swig_command_info swig_commands[] = { * 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 @@ -7182,9 +7032,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) { @@ -7203,27 +7051,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 */ @@ -7231,7 +7075,7 @@ SWIG_InitializeModule(void *clientdata) { /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; @@ -7239,7 +7083,7 @@ SWIG_InitializeModule(void *clientdata) { swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ @@ -7314,7 +7158,7 @@ SWIG_InitializeModule(void *clientdata) { for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; @@ -7364,37 +7208,43 @@ SWIG_PropagateClientData(void) { -#ifdef __cplusplus +#if defined(__cplusplus) && ! defined(XSPROTO) extern "C" #endif XS(SWIG_init) { dXSARGS; int i; + (void)items; SWIG_InitializeModule(0); /* Install commands */ for (i = 0; swig_commands[i].name; i++) { - newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); + /* Casts only needed for Perl < 5.10. */ +#ifdef __cplusplus + newXS(const_cast(swig_commands[i].name), swig_commands[i].wrapper, const_cast(__FILE__)); +#else + newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__); +#endif } /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; - sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); + sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { sv_setiv(sv,(IV) 0); } - swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); + swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); } /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; - sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); + sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); @@ -7403,7 +7253,7 @@ XS(SWIG_init) { sv_setnv(sv, (double) swig_constants[i].dvalue); break; case SWIG_STRING: - sv_setpv(sv, (char *) swig_constants[i].pvalue); + sv_setpv(sv, (const char *) swig_constants[i].pvalue); break; case SWIG_POINTER: SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); @@ -7420,92 +7270,92 @@ XS(SWIG_init) { SWIG_TypeClientData(SWIGTYPE_p_mecab_dictionary_info_t, (void*) "MeCab::DictionaryInfo"); SWIG_TypeClientData(SWIGTYPE_p_mecab_path_t, (void*) "MeCab::Path"); SWIG_TypeClientData(SWIGTYPE_p_mecab_node_t, (void*) "MeCab::Node"); - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_NOR_NODE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_NOR_NODE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_UNK_NODE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_UNK_NODE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_BOS_NODE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_BOS_NODE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_EOS_NODE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_EOS_NODE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_EON_NODE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_EON_NODE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_SYS_DIC", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_SYS_DIC))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_USR_DIC", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_USR_DIC))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_UNK_DIC", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_UNK_DIC))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_ONE_BEST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ONE_BEST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_NBEST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_NBEST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_PARTIAL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_PARTIAL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_MARGINAL_PROB", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_MARGINAL_PROB))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_ALTERNATIVE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ALTERNATIVE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_ALL_MORPHS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ALL_MORPHS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_ALLOCATE_SENTENCE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ALLOCATE_SENTENCE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_ANY_BOUNDARY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ANY_BOUNDARY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_TOKEN_BOUNDARY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_TOKEN_BOUNDARY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "MECAB_INSIDE_TOKEN", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_INSIDE_TOKEN))); SvREADONLY_on(sv); @@ -7513,7 +7363,7 @@ XS(SWIG_init) { SWIG_TypeClientData(SWIGTYPE_p_MeCab__Lattice, (void*) "MeCab::Lattice"); SWIG_TypeClientData(SWIGTYPE_p_MeCab__Model, (void*) "MeCab::Model"); SWIG_TypeClientData(SWIGTYPE_p_MeCab__Tagger, (void*) "MeCab::Tagger"); - /*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { + /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/perl5/perltypemaps.swg,65,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "VERSION", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_FromCharPtr("0.996")); SvREADONLY_on(sv); diff --git a/mecab/python/MeCab.py b/mecab/python/MeCab.py index d24acba..b2cdc62 100644 --- a/mecab/python/MeCab.py +++ b/mecab/python/MeCab.py @@ -1,180 +1,132 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 2.0.4 +# Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. +from sys import version_info as _swig_python_version_info +if _swig_python_version_info < (2, 7, 0): + raise RuntimeError("Python 2.7 or later required") - -from sys import version_info -if version_info >= (2,6,0): - def swig_import_helper(): - from os.path import dirname - import imp - fp = None - try: - fp, pathname, description = imp.find_module('_MeCab', [dirname(__file__)]) - except ImportError: - import _MeCab - return _MeCab - if fp is not None: - try: - _mod = imp.load_module('_MeCab', fp, pathname, description) - finally: - fp.close() - return _mod - _MeCab = swig_import_helper() - del swig_import_helper +# Import the low-level C/C++ module +if __package__ or "." in __name__: + from . import _MeCab else: import _MeCab -del version_info + try: - _swig_property = property -except NameError: - pass # Python < 2.2 doesn't have 'property'. -def _swig_setattr_nondynamic(self,class_type,name,value,static=1): - if (name == "thisown"): return self.this.own(value) - if (name == "this"): - if type(value).__name__ == 'SwigPyObject': - self.__dict__[name] = value - return - method = class_type.__swig_setmethods__.get(name,None) - if method: return method(self,value) - if (not static): - self.__dict__[name] = value - else: - raise AttributeError("You cannot add attributes to %s" % self) - -def _swig_setattr(self,class_type,name,value): - return _swig_setattr_nondynamic(self,class_type,name,value,0) - -def _swig_getattr(self,class_type,name): - if (name == "thisown"): return self.this.own() - method = class_type.__swig_getmethods__.get(name,None) - if method: return method(self) - raise AttributeError(name) + import builtins as __builtin__ +except ImportError: + import __builtin__ def _swig_repr(self): - try: strthis = "proxy of " + self.this.__repr__() - except: strthis = "" + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -try: - _object = object - _newclass = 1 -except AttributeError: - class _object : pass - _newclass = 0 - - -class DictionaryInfo(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, DictionaryInfo, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, DictionaryInfo, name) + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + +class DictionaryInfo(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - __swig_getmethods__["filename"] = _MeCab.DictionaryInfo_filename_get - if _newclass:filename = _swig_property(_MeCab.DictionaryInfo_filename_get) - __swig_getmethods__["charset"] = _MeCab.DictionaryInfo_charset_get - if _newclass:charset = _swig_property(_MeCab.DictionaryInfo_charset_get) - __swig_getmethods__["size"] = _MeCab.DictionaryInfo_size_get - if _newclass:size = _swig_property(_MeCab.DictionaryInfo_size_get) - __swig_getmethods__["type"] = _MeCab.DictionaryInfo_type_get - if _newclass:type = _swig_property(_MeCab.DictionaryInfo_type_get) - __swig_getmethods__["lsize"] = _MeCab.DictionaryInfo_lsize_get - if _newclass:lsize = _swig_property(_MeCab.DictionaryInfo_lsize_get) - __swig_getmethods__["rsize"] = _MeCab.DictionaryInfo_rsize_get - if _newclass:rsize = _swig_property(_MeCab.DictionaryInfo_rsize_get) - __swig_getmethods__["version"] = _MeCab.DictionaryInfo_version_get - if _newclass:version = _swig_property(_MeCab.DictionaryInfo_version_get) - __swig_getmethods__["next"] = _MeCab.DictionaryInfo_next_get - if _newclass:next = _swig_property(_MeCab.DictionaryInfo_next_get) - def __init__(self): - this = _MeCab.new_DictionaryInfo() - try: self.this.append(this) - except: self.this = this + filename = property(_MeCab.DictionaryInfo_filename_get) + charset = property(_MeCab.DictionaryInfo_charset_get) + size = property(_MeCab.DictionaryInfo_size_get) + type = property(_MeCab.DictionaryInfo_type_get) + lsize = property(_MeCab.DictionaryInfo_lsize_get) + rsize = property(_MeCab.DictionaryInfo_rsize_get) + version = property(_MeCab.DictionaryInfo_version_get) + next = property(_MeCab.DictionaryInfo_next_get) + + def __init__(self): + _MeCab.DictionaryInfo_swiginit(self, _MeCab.new_DictionaryInfo()) __swig_destroy__ = _MeCab.delete_DictionaryInfo - __del__ = lambda self : None; -DictionaryInfo_swigregister = _MeCab.DictionaryInfo_swigregister -DictionaryInfo_swigregister(DictionaryInfo) - -class Path(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Path, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Path, name) - def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") + +# Register DictionaryInfo in _MeCab: +_MeCab.DictionaryInfo_swigregister(DictionaryInfo) + +class Path(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined") __repr__ = _swig_repr - __swig_getmethods__["rnode"] = _MeCab.Path_rnode_get - if _newclass:rnode = _swig_property(_MeCab.Path_rnode_get) - __swig_getmethods__["rnext"] = _MeCab.Path_rnext_get - if _newclass:rnext = _swig_property(_MeCab.Path_rnext_get) - __swig_getmethods__["lnode"] = _MeCab.Path_lnode_get - if _newclass:lnode = _swig_property(_MeCab.Path_lnode_get) - __swig_getmethods__["lnext"] = _MeCab.Path_lnext_get - if _newclass:lnext = _swig_property(_MeCab.Path_lnext_get) - __swig_getmethods__["cost"] = _MeCab.Path_cost_get - if _newclass:cost = _swig_property(_MeCab.Path_cost_get) - __swig_setmethods__["prob"] = _MeCab.Path_prob_set - __swig_getmethods__["prob"] = _MeCab.Path_prob_get - if _newclass:prob = _swig_property(_MeCab.Path_prob_get, _MeCab.Path_prob_set) -Path_swigregister = _MeCab.Path_swigregister -Path_swigregister(Path) - -class Node(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Node, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Node, name) - def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") + rnode = property(_MeCab.Path_rnode_get) + rnext = property(_MeCab.Path_rnext_get) + lnode = property(_MeCab.Path_lnode_get) + lnext = property(_MeCab.Path_lnext_get) + cost = property(_MeCab.Path_cost_get) + prob = property(_MeCab.Path_prob_get, _MeCab.Path_prob_set) + +# Register Path in _MeCab: +_MeCab.Path_swigregister(Path) + +class Node(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined") __repr__ = _swig_repr - __swig_getmethods__["prev"] = _MeCab.Node_prev_get - if _newclass:prev = _swig_property(_MeCab.Node_prev_get) - __swig_getmethods__["next"] = _MeCab.Node_next_get - if _newclass:next = _swig_property(_MeCab.Node_next_get) - __swig_getmethods__["enext"] = _MeCab.Node_enext_get - if _newclass:enext = _swig_property(_MeCab.Node_enext_get) - __swig_getmethods__["bnext"] = _MeCab.Node_bnext_get - if _newclass:bnext = _swig_property(_MeCab.Node_bnext_get) - __swig_getmethods__["rpath"] = _MeCab.Node_rpath_get - if _newclass:rpath = _swig_property(_MeCab.Node_rpath_get) - __swig_getmethods__["lpath"] = _MeCab.Node_lpath_get - if _newclass:lpath = _swig_property(_MeCab.Node_lpath_get) - __swig_getmethods__["feature"] = _MeCab.Node_feature_get - if _newclass:feature = _swig_property(_MeCab.Node_feature_get) - __swig_getmethods__["id"] = _MeCab.Node_id_get - if _newclass:id = _swig_property(_MeCab.Node_id_get) - __swig_getmethods__["length"] = _MeCab.Node_length_get - if _newclass:length = _swig_property(_MeCab.Node_length_get) - __swig_getmethods__["rlength"] = _MeCab.Node_rlength_get - if _newclass:rlength = _swig_property(_MeCab.Node_rlength_get) - __swig_getmethods__["rcAttr"] = _MeCab.Node_rcAttr_get - if _newclass:rcAttr = _swig_property(_MeCab.Node_rcAttr_get) - __swig_getmethods__["lcAttr"] = _MeCab.Node_lcAttr_get - if _newclass:lcAttr = _swig_property(_MeCab.Node_lcAttr_get) - __swig_getmethods__["posid"] = _MeCab.Node_posid_get - if _newclass:posid = _swig_property(_MeCab.Node_posid_get) - __swig_getmethods__["char_type"] = _MeCab.Node_char_type_get - if _newclass:char_type = _swig_property(_MeCab.Node_char_type_get) - __swig_getmethods__["stat"] = _MeCab.Node_stat_get - if _newclass:stat = _swig_property(_MeCab.Node_stat_get) - __swig_getmethods__["isbest"] = _MeCab.Node_isbest_get - if _newclass:isbest = _swig_property(_MeCab.Node_isbest_get) - __swig_getmethods__["alpha"] = _MeCab.Node_alpha_get - if _newclass:alpha = _swig_property(_MeCab.Node_alpha_get) - __swig_getmethods__["beta"] = _MeCab.Node_beta_get - if _newclass:beta = _swig_property(_MeCab.Node_beta_get) - __swig_setmethods__["prob"] = _MeCab.Node_prob_set - __swig_getmethods__["prob"] = _MeCab.Node_prob_get - if _newclass:prob = _swig_property(_MeCab.Node_prob_get, _MeCab.Node_prob_set) - __swig_getmethods__["wcost"] = _MeCab.Node_wcost_get - if _newclass:wcost = _swig_property(_MeCab.Node_wcost_get) - __swig_getmethods__["cost"] = _MeCab.Node_cost_get - if _newclass:cost = _swig_property(_MeCab.Node_cost_get) - __swig_getmethods__["surface"] = _MeCab.Node_surface_get - if _newclass:surface = _swig_property(_MeCab.Node_surface_get) -Node_swigregister = _MeCab.Node_swigregister -Node_swigregister(Node) + prev = property(_MeCab.Node_prev_get) + next = property(_MeCab.Node_next_get) + enext = property(_MeCab.Node_enext_get) + bnext = property(_MeCab.Node_bnext_get) + rpath = property(_MeCab.Node_rpath_get) + lpath = property(_MeCab.Node_lpath_get) + feature = property(_MeCab.Node_feature_get) + id = property(_MeCab.Node_id_get) + length = property(_MeCab.Node_length_get) + rlength = property(_MeCab.Node_rlength_get) + rcAttr = property(_MeCab.Node_rcAttr_get) + lcAttr = property(_MeCab.Node_lcAttr_get) + posid = property(_MeCab.Node_posid_get) + char_type = property(_MeCab.Node_char_type_get) + stat = property(_MeCab.Node_stat_get) + isbest = property(_MeCab.Node_isbest_get) + alpha = property(_MeCab.Node_alpha_get) + beta = property(_MeCab.Node_beta_get) + prob = property(_MeCab.Node_prob_get, _MeCab.Node_prob_set) + wcost = property(_MeCab.Node_wcost_get) + cost = property(_MeCab.Node_cost_get) + surface = property(_MeCab.Node_surface_get) + +# Register Node in _MeCab: +_MeCab.Node_swigregister(Node) MECAB_NOR_NODE = _MeCab.MECAB_NOR_NODE MECAB_UNK_NODE = _MeCab.MECAB_UNK_NODE @@ -194,132 +146,221 @@ def __init__(self, *args, **kwargs): raise AttributeError("No constructor define MECAB_ANY_BOUNDARY = _MeCab.MECAB_ANY_BOUNDARY MECAB_TOKEN_BOUNDARY = _MeCab.MECAB_TOKEN_BOUNDARY MECAB_INSIDE_TOKEN = _MeCab.MECAB_INSIDE_TOKEN -class Lattice(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Lattice, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Lattice, name) +class Lattice(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def clear(self): return _MeCab.Lattice_clear(self) - def is_available(self): return _MeCab.Lattice_is_available(self) - def bos_node(self): return _MeCab.Lattice_bos_node(self) - def eos_node(self): return _MeCab.Lattice_eos_node(self) - def end_nodes(self, *args): return _MeCab.Lattice_end_nodes(self, *args) - def begin_nodes(self, *args): return _MeCab.Lattice_begin_nodes(self, *args) - def sentence(self): return _MeCab.Lattice_sentence(self) - def size(self): return _MeCab.Lattice_size(self) - def set_Z(self, *args): return _MeCab.Lattice_set_Z(self, *args) - def Z(self): return _MeCab.Lattice_Z(self) - def set_theta(self, *args): return _MeCab.Lattice_set_theta(self, *args) - def theta(self): return _MeCab.Lattice_theta(self) - def next(self): return _MeCab.Lattice_next(self) - def request_type(self): return _MeCab.Lattice_request_type(self) - def has_request_type(self, *args): return _MeCab.Lattice_has_request_type(self, *args) - def set_request_type(self, *args): return _MeCab.Lattice_set_request_type(self, *args) - def add_request_type(self, *args): return _MeCab.Lattice_add_request_type(self, *args) - def remove_request_type(self, *args): return _MeCab.Lattice_remove_request_type(self, *args) - def newNode(self): return _MeCab.Lattice_newNode(self) - def toString(self, *args): return _MeCab.Lattice_toString(self, *args) - def enumNBestAsString(self, *args): return _MeCab.Lattice_enumNBestAsString(self, *args) - def has_constraint(self): return _MeCab.Lattice_has_constraint(self) - def boundary_constraint(self, *args): return _MeCab.Lattice_boundary_constraint(self, *args) - def feature_constraint(self, *args): return _MeCab.Lattice_feature_constraint(self, *args) - def set_boundary_constraint(self, *args): return _MeCab.Lattice_set_boundary_constraint(self, *args) - def set_feature_constraint(self, *args): return _MeCab.Lattice_set_feature_constraint(self, *args) - def set_result(self, *args): return _MeCab.Lattice_set_result(self, *args) - def what(self): return _MeCab.Lattice_what(self) - def set_what(self, *args): return _MeCab.Lattice_set_what(self, *args) + + def clear(self): + return _MeCab.Lattice_clear(self) + + def is_available(self): + return _MeCab.Lattice_is_available(self) + + def bos_node(self): + return _MeCab.Lattice_bos_node(self) + + def eos_node(self): + return _MeCab.Lattice_eos_node(self) + + def end_nodes(self, pos): + return _MeCab.Lattice_end_nodes(self, pos) + + def begin_nodes(self, pos): + return _MeCab.Lattice_begin_nodes(self, pos) + + def sentence(self): + return _MeCab.Lattice_sentence(self) + + def size(self): + return _MeCab.Lattice_size(self) + + def set_Z(self, Z): + return _MeCab.Lattice_set_Z(self, Z) + + def Z(self): + return _MeCab.Lattice_Z(self) + + def set_theta(self, theta): + return _MeCab.Lattice_set_theta(self, theta) + + def theta(self): + return _MeCab.Lattice_theta(self) + + def next(self): + return _MeCab.Lattice_next(self) + + def request_type(self): + return _MeCab.Lattice_request_type(self) + + def has_request_type(self, request_type): + return _MeCab.Lattice_has_request_type(self, request_type) + + def set_request_type(self, request_type): + return _MeCab.Lattice_set_request_type(self, request_type) + + def add_request_type(self, request_type): + return _MeCab.Lattice_add_request_type(self, request_type) + + def remove_request_type(self, request_type): + return _MeCab.Lattice_remove_request_type(self, request_type) + + def newNode(self): + return _MeCab.Lattice_newNode(self) + + def toString(self, *args): + return _MeCab.Lattice_toString(self, *args) + + def enumNBestAsString(self, N): + return _MeCab.Lattice_enumNBestAsString(self, N) + + def has_constraint(self): + return _MeCab.Lattice_has_constraint(self) + + def boundary_constraint(self, pos): + return _MeCab.Lattice_boundary_constraint(self, pos) + + def feature_constraint(self, pos): + return _MeCab.Lattice_feature_constraint(self, pos) + + def set_boundary_constraint(self, pos, boundary_constraint_type): + return _MeCab.Lattice_set_boundary_constraint(self, pos, boundary_constraint_type) + + def set_feature_constraint(self, begin_pos, end_pos, feature): + return _MeCab.Lattice_set_feature_constraint(self, begin_pos, end_pos, feature) + + def set_result(self, result): + return _MeCab.Lattice_set_result(self, result) + + def what(self): + return _MeCab.Lattice_what(self) + + def set_what(self, str): + return _MeCab.Lattice_set_what(self, str) __swig_destroy__ = _MeCab.delete_Lattice - __del__ = lambda self : None; - def __init__(self): - this = _MeCab.new_Lattice() - try: self.this.append(this) - except: self.this = this - def set_sentence(self, *args): return _MeCab.Lattice_set_sentence(self, *args) -Lattice_swigregister = _MeCab.Lattice_swigregister -Lattice_swigregister(Lattice) - -class Model(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Model, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Model, name) + + def __init__(self): + _MeCab.Lattice_swiginit(self, _MeCab.new_Lattice()) + + def set_sentence(self, sentence): + return _MeCab.Lattice_set_sentence(self, sentence) + +# Register Lattice in _MeCab: +_MeCab.Lattice_swigregister(Lattice) + +class Model(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def dictionary_info(self): return _MeCab.Model_dictionary_info(self) - def transition_cost(self, *args): return _MeCab.Model_transition_cost(self, *args) - def lookup(self, *args): return _MeCab.Model_lookup(self, *args) - def createTagger(self): return _MeCab.Model_createTagger(self) - def createLattice(self): return _MeCab.Model_createLattice(self) - def swap(self, *args): return _MeCab.Model_swap(self, *args) - __swig_getmethods__["version"] = lambda x: _MeCab.Model_version - if _newclass:version = staticmethod(_MeCab.Model_version) + + def dictionary_info(self): + return _MeCab.Model_dictionary_info(self) + + def transition_cost(self, rcAttr, lcAttr): + return _MeCab.Model_transition_cost(self, rcAttr, lcAttr) + + def lookup(self, begin, end, lattice): + return _MeCab.Model_lookup(self, begin, end, lattice) + + def createTagger(self): + return _MeCab.Model_createTagger(self) + + def createLattice(self): + return _MeCab.Model_createLattice(self) + + def swap(self, model): + return _MeCab.Model_swap(self, model) + + @staticmethod + def version(): + return _MeCab.Model_version() __swig_destroy__ = _MeCab.delete_Model - __del__ = lambda self : None; - __swig_getmethods__["create"] = lambda x: _MeCab.Model_create - if _newclass:create = staticmethod(_MeCab.Model_create) - def __init__(self, *args): - this = _MeCab.new_Model(*args) - try: self.this.append(this) - except: self.this = this -Model_swigregister = _MeCab.Model_swigregister -Model_swigregister(Model) + + def __init__(self, *args): + _MeCab.Model_swiginit(self, _MeCab.new_Model(*args)) + +# Register Model in _MeCab: +_MeCab.Model_swigregister(Model) def Model_version(): - return _MeCab.Model_version() -Model_version = _MeCab.Model_version - -def Model_create(*args): - return _MeCab.Model_create(*args) -Model_create = _MeCab.Model_create - -class Tagger(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Tagger, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Tagger, name) + return _MeCab.Model_version() + +class Tagger(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def parse(self, *args): return _MeCab.Tagger_parse(self, *args) - def parseToNode(self, *args): return _MeCab.Tagger_parseToNode(self, *args) - def parseNBest(self, *args): return _MeCab.Tagger_parseNBest(self, *args) - def parseNBestInit(self, *args): return _MeCab.Tagger_parseNBestInit(self, *args) - def nextNode(self): return _MeCab.Tagger_nextNode(self) - def next(self): return _MeCab.Tagger_next(self) - def formatNode(self, *args): return _MeCab.Tagger_formatNode(self, *args) - def set_request_type(self, *args): return _MeCab.Tagger_set_request_type(self, *args) - def request_type(self): return _MeCab.Tagger_request_type(self) - def partial(self): return _MeCab.Tagger_partial(self) - def set_partial(self, *args): return _MeCab.Tagger_set_partial(self, *args) - def lattice_level(self): return _MeCab.Tagger_lattice_level(self) - def set_lattice_level(self, *args): return _MeCab.Tagger_set_lattice_level(self, *args) - def all_morphs(self): return _MeCab.Tagger_all_morphs(self) - def set_all_morphs(self, *args): return _MeCab.Tagger_set_all_morphs(self, *args) - def set_theta(self, *args): return _MeCab.Tagger_set_theta(self, *args) - def theta(self): return _MeCab.Tagger_theta(self) - def dictionary_info(self): return _MeCab.Tagger_dictionary_info(self) - def what(self): return _MeCab.Tagger_what(self) + + def parse(self, *args): + return _MeCab.Tagger_parse(self, *args) + + def parseToNode(self, str): + return _MeCab.Tagger_parseToNode(self, str) + + def parseNBest(self, N, str): + return _MeCab.Tagger_parseNBest(self, N, str) + + def parseNBestInit(self, str): + return _MeCab.Tagger_parseNBestInit(self, str) + + def nextNode(self): + return _MeCab.Tagger_nextNode(self) + + def next(self): + return _MeCab.Tagger_next(self) + + def formatNode(self, node): + return _MeCab.Tagger_formatNode(self, node) + + def set_request_type(self, request_type): + return _MeCab.Tagger_set_request_type(self, request_type) + + def request_type(self): + return _MeCab.Tagger_request_type(self) + + def partial(self): + return _MeCab.Tagger_partial(self) + + def set_partial(self, partial): + return _MeCab.Tagger_set_partial(self, partial) + + def lattice_level(self): + return _MeCab.Tagger_lattice_level(self) + + def set_lattice_level(self, level): + return _MeCab.Tagger_set_lattice_level(self, level) + + def all_morphs(self): + return _MeCab.Tagger_all_morphs(self) + + def set_all_morphs(self, all_morphs): + return _MeCab.Tagger_set_all_morphs(self, all_morphs) + + def set_theta(self, theta): + return _MeCab.Tagger_set_theta(self, theta) + + def theta(self): + return _MeCab.Tagger_theta(self) + + def dictionary_info(self): + return _MeCab.Tagger_dictionary_info(self) + + def what(self): + return _MeCab.Tagger_what(self) __swig_destroy__ = _MeCab.delete_Tagger - __del__ = lambda self : None; - __swig_getmethods__["create"] = lambda x: _MeCab.Tagger_create - if _newclass:create = staticmethod(_MeCab.Tagger_create) - __swig_getmethods__["version"] = lambda x: _MeCab.Tagger_version - if _newclass:version = staticmethod(_MeCab.Tagger_version) - def __init__(self, *args): - this = _MeCab.new_Tagger(*args) - try: self.this.append(this) - except: self.this = this - def parseToString(self, *args): return _MeCab.Tagger_parseToString(self, *args) -Tagger_swigregister = _MeCab.Tagger_swigregister -Tagger_swigregister(Tagger) - -def Tagger_create(*args): - return _MeCab.Tagger_create(*args) -Tagger_create = _MeCab.Tagger_create + + @staticmethod + def version(): + return _MeCab.Tagger_version() + + def __init__(self, *args): + _MeCab.Tagger_swiginit(self, _MeCab.new_Tagger(*args)) + + def parseToString(self, str, length=0): + return _MeCab.Tagger_parseToString(self, str, length) + +# Register Tagger in _MeCab: +_MeCab.Tagger_swigregister(Tagger) def Tagger_version(): - return _MeCab.Tagger_version() -Tagger_version = _MeCab.Tagger_version + return _MeCab.Tagger_version() VERSION = _MeCab.VERSION -# This file is compatible with both classic and new-style classes. diff --git a/mecab/python/MeCab_wrap.cxx b/mecab/python/MeCab_wrap.cxx index 2513e7c..4f76810 100644 --- a/mecab/python/MeCab_wrap.cxx +++ b/mecab/python/MeCab_wrap.cxx @@ -1,14 +1,18 @@ /* ---------------------------------------------------------------------------- * 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 4.0.2 + * + * 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_DIRECTOR_NO_VTABLE @@ -66,28 +70,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 +106,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 +136,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 +149,34 @@ 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 + +#if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) +/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */ +# include +#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 1 +#else +# include +#endif /* ----------------------------------------------------------------------------- * swigrun.swg @@ -172,7 +202,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. */ @@ -193,21 +223,22 @@ template T SwigValueInit() { /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 /* Flags for new pointer objects */ #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 +271,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 +301,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 +342,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 +393,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 +413,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 +432,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 +466,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 +501,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 +545,7 @@ SWIG_TypePrettyName(const swig_type_info *type) { return type->name; } -/* +/* Set the clientdata field for a type */ SWIGRUNTIME void @@ -533,14 +553,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 +569,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 +618,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 +636,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 +644,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 +753,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 +776,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) @@ -787,25 +808,31 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { -#if PY_VERSION_HEX >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; +#if PY_VERSION_HEX >= 0x03030000 + return (char *)PyUnicode_AsUTF8(str); +#elif PY_VERSION_HEX >= 0x03000000 + char *newstr = 0; str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); + if (str) { + char *cstr; + Py_ssize_t len; + if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) { + newstr = (char *) malloc(len+1); + if (newstr) + memcpy(newstr, cstr, len+1); + } + Py_XDECREF(str); + } return newstr; #else return PyString_AsString(str); #endif } -#if PY_VERSION_HEX >= 0x03000000 -# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000 +# define SWIG_Python_str_DelForPy3(x) #else -# define SWIG_Python_str_DelForPy3(x) +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) #endif @@ -819,148 +846,19 @@ SWIG_Python_str_FromChar(const char *c) #endif } -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#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 -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif - -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -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 < 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)) +// SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user +// interface files check for it. # define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif +# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) #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 /* ----------------------------------------------------------------------------- @@ -1018,14 +916,17 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyObject *value = 0; PyObject *traceback = 0; - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (PyErr_Occurred()) + PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); PyErr_Clear(); Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + if (tmp) + PyErr_Format(type, "%s %s", tmp, mesg); + else + PyErr_Format(type, "%s", mesg); SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); @@ -1034,6 +935,37 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } +SWIGRUNTIME int +SWIG_Python_TypeErrorOccurred(PyObject *obj) +{ + PyObject *error; + if (obj) + return 0; + error = PyErr_Occurred(); + return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); +} + +SWIGRUNTIME void +SWIG_Python_RaiseOrModifyTypeError(const char *message) +{ + if (SWIG_Python_TypeErrorOccurred(NULL)) { + /* Use existing TypeError to preserve stacktrace and enhance with given message */ + PyObject *newvalue; + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); +#if PY_VERSION_HEX >= 0x03000000 + newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); +#else + newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); +#endif + Py_XDECREF(value); + PyErr_Restore(type, newvalue, traceback); + } else { + /* Raise TypeError using given message */ + PyErr_SetString(PyExc_TypeError, message); + } +} + #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -1041,9 +973,7 @@ SWIG_Python_AddErrorMsg(const char* mesg) #endif #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif +# define SWIG_PYTHON_USE_GIL # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ # ifndef SWIG_PYTHON_INITIALIZE_THREADS @@ -1120,30 +1050,13 @@ extern "C" { /* Constant information structure */ typedef struct swig_const_info { int type; - char *name; + const char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_const_info; - -/* ----------------------------------------------------------------------------- - * Wrapper of PyInstanceMethod_New() used in Python 3 - * It is exported to the generated module, used for -fastproxy - * ----------------------------------------------------------------------------- */ -#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 - #ifdef __cplusplus } #endif @@ -1158,6 +1071,14 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), * * ----------------------------------------------------------------------------- */ +#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ +# error "This version of SWIG only supports Python >= 2.7" +#endif + +#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000 +# error "This version of SWIG only supports Python 3 >= 3.2" +#endif + /* Common SWIG API */ /* for raw pointers */ @@ -1196,7 +1117,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 +1143,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 +1162,7 @@ SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { - PyDict_SetItemString(d, (char *)name, obj); + PyDict_SetItemString(d, name, obj); Py_DECREF(obj); if (public_interface) SwigPyBuiltin_AddPublicSymbol(public_interface, name); @@ -1251,7 +1172,7 @@ SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *nam SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, (char *)name, obj); + PyDict_SetItemString(d, name, obj); Py_DECREF(obj); } @@ -1261,7 +1182,6 @@ SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { SWIGINTERN PyObject* SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) if (!result) { result = obj; } else if (result == Py_None) { @@ -1277,34 +1197,11 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { Py_DECREF(obj); } return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif } /* 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 +1215,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 +1225,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 +1235,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); } @@ -1350,12 +1247,21 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } } +SWIGINTERN int +SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { + int no_kwargs = 1; + if (kwargs) { + assert(PyDict_Check(kwargs)); + if (PyDict_Size(kwargs) > 0) { + PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); + no_kwargs = 0; + } + } + return no_kwargs; +} + /* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif /* Helper for static pointer initialization for both C and C++ code, for example @@ -1384,35 +1290,6 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi extern "C" { #endif -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - /* The python void return value */ SWIGRUNTIMEINLINE PyObject * @@ -1439,7 +1316,10 @@ SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; + int fail = data ? data->implicitconv : 0; + if (fail) + PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); + return fail; } SWIGRUNTIMEINLINE PyObject * @@ -1466,11 +1346,7 @@ SwigPyClientData_New(PyObject* obj) data->newargs = obj; Py_INCREF(obj); } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif + data->newraw = PyObject_GetAttrString(data->klass, "__new__"); if (data->newraw) { Py_INCREF(data->newraw); data->newargs = PyTuple_New(1); @@ -1481,7 +1357,7 @@ SwigPyClientData_New(PyObject* obj) Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); if (PyErr_Occurred()) { PyErr_Clear(); data->destroy = 0; @@ -1490,11 +1366,7 @@ SwigPyClientData_New(PyObject* obj) int flags; Py_INCREF(data->destroy); flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif } else { data->delargs = 0; } @@ -1524,6 +1396,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) { @@ -1565,20 +1454,12 @@ SwigPyObject_hex(SwigPyObject *v) } SWIGRUNTIME PyObject * -#ifdef METH_NOARGS SwigPyObject_repr(SwigPyObject *v) -#else -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); -# else - PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); -# endif # if PY_VERSION_HEX >= 0x03000000 PyObject *joined = PyUnicode_Concat(repr, nrep); Py_DecRef(repr); @@ -1591,32 +1472,12 @@ 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; - } -} - +/* We need a version taking two PyObject* parameters so it's a valid + * PyCFunction to use in swigobject_methods[]. */ SWIGRUNTIME PyObject * -SwigPyObject_str(SwigPyObject *v) +SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) { - char result[SWIG_BUFFER_SIZE]; - return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - SWIG_Python_str_FromChar(result) : 0; + return SwigPyObject_repr((SwigPyObject*)v); } SWIGRUNTIME int @@ -1690,16 +1551,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 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 *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); + 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(type, value, traceback); + Py_XDECREF(res); } #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) @@ -1717,12 +1594,8 @@ SWIGRUNTIME PyObject* SwigPyObject_append(PyObject* v, PyObject* next) { SwigPyObject *sobj = (SwigPyObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif if (!SwigPyObject_Check(next)) { + PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); return NULL; } sobj->next = next; @@ -1731,11 +1604,7 @@ SwigPyObject_append(PyObject* v, PyObject* next) } SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -SwigPyObject_next(PyObject* v) -#else SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { @@ -1747,11 +1616,7 @@ SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_disown(PyObject *v) -#else SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; @@ -1759,11 +1624,7 @@ SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } SWIGINTERN PyObject* -#ifdef METH_NOARGS -SwigPyObject_acquire(PyObject *v) -#else SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; @@ -1774,68 +1635,32 @@ SWIGINTERN PyObject* SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#else - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#endif - { - return NULL; + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { + return NULL; + } else { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } } - else - { - SwigPyObject *sobj = (SwigPyObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v); - } else { - SwigPyObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - SwigPyObject_acquire(v,args); - } else { - SwigPyObject_disown(v,args); - } -#endif - } - return obj; - } + return obj; + } } -#ifdef METH_O 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 *)"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"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, + {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, + {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, + {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, + {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, + {"__repr__",SwigPyObject_repr2, METH_NOARGS, "returns object representation"}, {0, 0, 0, 0} }; -#else -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 *)"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"}, - {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -SwigPyObject_getattr(SwigPyObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) { @@ -1876,14 +1701,12 @@ 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 */ +#else 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ #endif }; @@ -1891,26 +1714,21 @@ 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 PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"SwigPyObject", /* tp_name */ + "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 */ -#else + 0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ -#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 +1738,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 */ @@ -1930,7 +1748,6 @@ SwigPyObject_TypeOnce(void) { 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 */ @@ -1951,25 +1768,29 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ #endif }; swigpyobject_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpyobject_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&swigpyobject_type) < 0) return NULL; -#endif } return &swigpyobject_type; } @@ -1998,20 +1819,6 @@ typedef struct { size_t size; } SwigPyPacked; -SWIGRUNTIME int -SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v) { @@ -2040,7 +1847,7 @@ SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) size_t i = v->size; size_t j = w->size; int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); + return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); @@ -2074,18 +1881,17 @@ 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 PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"SwigPyPacked", /* tp_name */ + "SwigPyPacked", /* tp_name */ sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 @@ -2109,7 +1915,6 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ @@ -2130,25 +1935,29 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ #endif }; swigpypacked_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - swigpypacked_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&swigpypacked_type) < 0) return NULL; -#endif } return &swigpypacked_type; } @@ -2189,20 +1998,14 @@ SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) * pointers/data manipulation * ----------------------------------------------------------------------------- */ -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; +static PyObject *Swig_This_global = NULL; SWIGRUNTIME PyObject * SWIG_This(void) { - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; + if (Swig_This_global == NULL) + Swig_This_global = SWIG_Python_str_FromChar("this"); + return Swig_This_global; } /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ @@ -2234,7 +2037,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) obj = 0; -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) if (PyInstance_Check(pyobj)) { obj = _PyInstance_Lookup(pyobj, SWIG_This()); } else { @@ -2297,13 +2100,14 @@ 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; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } res = SWIG_ERROR; @@ -2349,7 +2153,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; @@ -2383,6 +2187,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; @@ -2396,31 +2207,28 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { return SWIG_ConvertPtr(obj, ptr, ty, 0); } else { void *vptr = 0; - + swig_cast_info *tc; + /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) + if (!desc) return SWIG_ERROR; - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (tc) { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,vptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - } else { - return SWIG_ERROR; - } + tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ } else { - *ptr = vptr; + return SWIG_ERROR; } return SWIG_OK; } } -/* Convert a packed value value */ +/* Convert a packed pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { @@ -2448,7 +2256,6 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t SWIGRUNTIME PyObject* SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { -#if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; PyObject *newraw = data->newraw; if (newraw) { @@ -2465,88 +2272,73 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) } } #else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } #endif } } 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; + PyObject *empty_args = PyTuple_New(0); + if (empty_args) { + PyObject *empty_kwargs = PyDict_New(); + if (empty_kwargs) { + inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); + Py_DECREF(empty_kwargs); + if (inst) { + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } else { + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } + } + } + Py_DECREF(empty_args); + } #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 *dict = PyDict_New(); - 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); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif } -SWIGRUNTIME void +SWIGRUNTIME int SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { - PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + return PyDict_SetItem(dict, SWIG_This(), swig_this); + } #endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); + return PyObject_SetAttr(inst, SWIG_This(), 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]); if (sthis) { SwigPyObject_append((PyObject*) sthis, obj[1]); } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); + if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) + return NULL; } return SWIG_Py_Void(); } @@ -2575,18 +2367,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 +2390,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,19 +2414,14 @@ 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) { #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; @@ -2643,50 +2431,10 @@ SWIG_Python_GetModule(void) { return (swig_module_info *) type_pointer; } -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -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"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, - "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#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) { @@ -2697,33 +2445,24 @@ SWIG_Python_DestroyModule(void *vptr) } } Py_DECREF(SWIG_This()); - swig_this = NULL; + Swig_This_global = NULL; } SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { #if PY_VERSION_HEX >= 0x03000000 /* Add a dummy module object into sys.modules */ - PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); + PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION); #else 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); + PyObject *module = Py_InitModule("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); + PyModule_AddObject(module, "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 */ @@ -2741,20 +2480,12 @@ SWIG_Python_TypeQuery(const char *type) 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); } @@ -2779,14 +2510,15 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); + const char *errmesg = tmp ? tmp : "Invalid error message"; Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + PyErr_Format(type, "%s %s", mesg, errmesg); } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + PyErr_Format(type, "%s %s", errmesg, mesg); } SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); @@ -2815,7 +2547,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 +2604,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 +2634,6 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { goto done; } - res = -1; descr = _PyType_Lookup(tp, name); f = NULL; if (descr != NULL) @@ -2912,6 +2644,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { Py_INCREF(name); } else { encoded_name = PyUnicode_AsUTF8String(name); + if (!encoded_name) + return -1; } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); @@ -2923,6 +2657,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { Py_DECREF(name); return res; } +#endif #ifdef __cplusplus @@ -2937,6 +2672,21 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { +#ifdef __cplusplus +extern "C" { +#endif + +/* Method creation and docstring support functions */ + +SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); +SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); +SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); + +#ifdef __cplusplus +} +#endif + + #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) @@ -2950,19 +2700,17 @@ 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) /* -------- TYPES TABLE (END) -------- */ -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif +#ifdef SWIG_TypeQuery +# undef SWIG_TypeQuery #endif +#define SWIG_TypeQuery SWIG_Python_TypeQuery /*----------------------------------------------- @(target):= _MeCab.so @@ -2976,7 +2724,7 @@ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; #endif #define SWIG_name "_MeCab" -#define SWIGVERSION 0x020004 +#define SWIGVERSION 0x040002 #define SWIG_VERSION SWIGVERSION @@ -2999,27 +2747,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 +2900,13 @@ 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)); + return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape"); +#endif +#else + return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size)); #endif } } else { @@ -3162,6 +2922,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 +2943,65 @@ 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(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# elif defined(__clang__) && defined(__has_builtin) +# if __has_builtin(__builtin_isfinite) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# endif +# 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 +3011,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 +3056,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 +3097,6 @@ SWIGINTERNINLINE PyObject* } -#include - - SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max) { double x = *d; @@ -3324,6 +3130,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 +3139,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 +3175,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 +3341,19 @@ 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; + int ret = SWIG_OK; #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,48 +3362,75 @@ 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; + if (!obj) + return SWIG_TypeError; + if (alloc) + *alloc = SWIG_NEWOBJ; +#endif + if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; #else - PyString_AsStringAndSize(obj, &cstr, &len); + if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; #endif if (cptr) { if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { - *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } - else { + if (*alloc == SWIG_NEWOBJ) { + *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); + if (!*cptr) + ret = SWIG_TypeError; +#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; + return ret; } 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 (!obj) + return SWIG_TypeError; + 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 +3472,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 +3493,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 +3516,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 +3539,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 +3562,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 +3585,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 +3608,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 +3631,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 +3654,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 +3676,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 +3700,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 +3729,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, "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 +3766,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 +3789,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 +3812,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 +3835,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 +3861,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 +3887,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 +3907,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, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_mecab_path_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -3973,11 +3917,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 +3940,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 +3963,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 +3986,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 +4009,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 +4032,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 +4055,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 +4078,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 +4101,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 +4124,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 +4147,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 +4170,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 +4193,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 +4216,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 +4239,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 +4262,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 +4285,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 +4308,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 +4334,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 +4360,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 +4383,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 +4406,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 +4429,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 +4460,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, "swigregister", 1, 1, &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_mecab_node_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -4505,10 +4470,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 +4502,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 +4535,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 +4568,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 +4604,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 +4644,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 +4681,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 +4714,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 +4750,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 +4786,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 +4822,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 +4858,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 +4891,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 +4924,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 +4960,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 +5000,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 +5039,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 +5078,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 +5114,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 +5142,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), Py_ssize_t 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 +5173,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), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *arg2 = (MeCab::Node *) 0 ; @@ -5214,17 +5181,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,22 +5213,20 @@ 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) { @@ -5276,13 +5239,13 @@ SWIGINTERN PyObject *_wrap_Lattice_toString(PyObject *self, PyObject *args) { 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: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Lattice_toString'.\n" + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Lattice_toString'.\n" " Possible C/C++ prototypes are:\n" " MeCab::Lattice::toString()\n" " MeCab::Lattice::toString(MeCab::Node const *)\n"); @@ -5298,17 +5261,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 +5298,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 +5334,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 +5374,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 +5417,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 +5468,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 +5520,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 +5558,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 +5595,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 +5633,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 +5664,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 +5692,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 +5727,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, "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 +5780,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 +5833,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 +5884,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 *""'"); } @@ -5949,7 +5905,7 @@ SWIGINTERN PyObject *_wrap_Model_createTagger(PyObject *SWIGUNUSEDPARM(self), Py SWIG_exception (SWIG_RuntimeError, (char*)e); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; @@ -5961,11 +5917,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 *""'"); } @@ -5981,7 +5938,7 @@ SWIGINTERN PyObject *_wrap_Model_createLattice(PyObject *SWIGUNUSEDPARM(self), P SWIG_exception (SWIG_RuntimeError, (char*)e); } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; @@ -5996,17 +5953,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 +5989,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 +6013,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 +6040,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) { - 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) { +SWIGINTERN PyObject *_wrap_new_Model__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t 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: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 +6074,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), Py_ssize_t 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,29 +6098,27 @@ 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: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Model'.\n" + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_Model'.\n" " Possible C/C++ prototypes are:\n" " MeCab::Model::Model(char const *)\n" " MeCab::Model::Model()\n"); @@ -6293,12 +6128,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, "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), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Model *arg1 = 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; @@ -6306,12 +6145,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 +6156,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 +6179,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), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; @@ -6350,17 +6187,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 +6218,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), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -6392,17 +6227,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,25 +6261,23 @@ 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); + int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_MeCab__Model, SWIG_POINTER_NO_NULL | 0); _v = SWIG_CheckState(res); if (_v) { 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); + return _wrap_Tagger_parse__SWIG_0(self, argc, argv); } } } @@ -6460,7 +6291,7 @@ SWIGINTERN PyObject *_wrap_Tagger_parse(PyObject *self, PyObject *args) { 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); + return _wrap_Tagger_parse__SWIG_1(self, argc, argv); } } } @@ -6473,13 +6304,13 @@ SWIGINTERN PyObject *_wrap_Tagger_parse(PyObject *self, PyObject *args) { 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: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Tagger_parse'.\n" + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Tagger_parse'.\n" " Possible C/C++ prototypes are:\n" " MeCab::Tagger::parse(MeCab::Model const &,MeCab::Lattice *)\n" " MeCab::Tagger::parse(MeCab::Lattice *) const\n" @@ -6497,17 +6328,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 +6374,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 +6422,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 +6461,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 +6494,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 +6530,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 +6570,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 +6606,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 +6639,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 +6675,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 +6711,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 +6747,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 +6783,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 +6819,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 +6858,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 +6894,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 +6927,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 +6960,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 +6993,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 +7020,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 +7043,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), Py_ssize_t 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 +7077,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), Py_ssize_t 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,29 +7101,27 @@ 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: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Tagger'.\n" + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_Tagger'.\n" " Possible C/C++ prototypes are:\n" " MeCab::Tagger::Tagger(char const *)\n" " MeCab::Tagger::Tagger()\n"); @@ -7420,7 +7129,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), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -7432,23 +7141,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 +7179,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), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; @@ -7482,17 +7188,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,15 +7222,13 @@ 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; @@ -7536,7 +7238,7 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToString(PyObject *self, PyObject *args) 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); } } } @@ -7554,14 +7256,14 @@ SWIGINTERN PyObject *_wrap_Tagger_parseToString(PyObject *self, PyObject *args) _v = SWIG_CheckState(res); } if (_v) { - return _wrap_Tagger_parseToString__SWIG_0(self, args); + return _wrap_Tagger_parseToString__SWIG_0(self, argc, argv); } } } } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Tagger_parseToString'.\n" + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Tagger_parseToString'.\n" " Possible C/C++ prototypes are:\n" " MeCab::Tagger::parseToString(char const *,size_t)\n" " MeCab::Tagger::parseToString(char const *)\n"); @@ -7571,125 +7273,135 @@ 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, "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_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 *)"Path_prob_set", _wrap_Path_prob_set, METH_VARARGS, NULL}, - { (char *)"Path_prob_get", _wrap_Path_prob_get, METH_VARARGS, 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_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_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_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_set_Z", _wrap_Lattice_set_Z, METH_VARARGS, NULL}, - { (char *)"Lattice_Z", _wrap_Lattice_Z, METH_VARARGS, 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_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_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_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_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 *)"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 *)"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_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 *)"new_Model", _wrap_new_Model, METH_VARARGS, NULL}, - { (char *)"Model_swigregister", Model_swigregister, 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_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_set_partial", _wrap_Tagger_set_partial, METH_VARARGS, NULL}, - { (char *)"Tagger_lattice_level", _wrap_Tagger_lattice_level, METH_VARARGS, 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_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 *)"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}, + { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, + { "DictionaryInfo_filename_get", _wrap_DictionaryInfo_filename_get, METH_O, NULL}, + { "DictionaryInfo_charset_get", _wrap_DictionaryInfo_charset_get, METH_O, NULL}, + { "DictionaryInfo_size_get", _wrap_DictionaryInfo_size_get, METH_O, NULL}, + { "DictionaryInfo_type_get", _wrap_DictionaryInfo_type_get, METH_O, NULL}, + { "DictionaryInfo_lsize_get", _wrap_DictionaryInfo_lsize_get, METH_O, NULL}, + { "DictionaryInfo_rsize_get", _wrap_DictionaryInfo_rsize_get, METH_O, NULL}, + { "DictionaryInfo_version_get", _wrap_DictionaryInfo_version_get, METH_O, NULL}, + { "DictionaryInfo_next_get", _wrap_DictionaryInfo_next_get, METH_O, NULL}, + { "new_DictionaryInfo", _wrap_new_DictionaryInfo, METH_NOARGS, NULL}, + { "delete_DictionaryInfo", _wrap_delete_DictionaryInfo, METH_O, NULL}, + { "DictionaryInfo_swigregister", DictionaryInfo_swigregister, METH_O, NULL}, + { "DictionaryInfo_swiginit", DictionaryInfo_swiginit, METH_VARARGS, NULL}, + { "Path_rnode_get", _wrap_Path_rnode_get, METH_O, NULL}, + { "Path_rnext_get", _wrap_Path_rnext_get, METH_O, NULL}, + { "Path_lnode_get", _wrap_Path_lnode_get, METH_O, NULL}, + { "Path_lnext_get", _wrap_Path_lnext_get, METH_O, NULL}, + { "Path_cost_get", _wrap_Path_cost_get, METH_O, NULL}, + { "Path_prob_set", _wrap_Path_prob_set, METH_VARARGS, NULL}, + { "Path_prob_get", _wrap_Path_prob_get, METH_O, NULL}, + { "Path_swigregister", Path_swigregister, METH_O, NULL}, + { "Node_prev_get", _wrap_Node_prev_get, METH_O, NULL}, + { "Node_next_get", _wrap_Node_next_get, METH_O, NULL}, + { "Node_enext_get", _wrap_Node_enext_get, METH_O, NULL}, + { "Node_bnext_get", _wrap_Node_bnext_get, METH_O, NULL}, + { "Node_rpath_get", _wrap_Node_rpath_get, METH_O, NULL}, + { "Node_lpath_get", _wrap_Node_lpath_get, METH_O, NULL}, + { "Node_feature_get", _wrap_Node_feature_get, METH_O, NULL}, + { "Node_id_get", _wrap_Node_id_get, METH_O, NULL}, + { "Node_length_get", _wrap_Node_length_get, METH_O, NULL}, + { "Node_rlength_get", _wrap_Node_rlength_get, METH_O, NULL}, + { "Node_rcAttr_get", _wrap_Node_rcAttr_get, METH_O, NULL}, + { "Node_lcAttr_get", _wrap_Node_lcAttr_get, METH_O, NULL}, + { "Node_posid_get", _wrap_Node_posid_get, METH_O, NULL}, + { "Node_char_type_get", _wrap_Node_char_type_get, METH_O, NULL}, + { "Node_stat_get", _wrap_Node_stat_get, METH_O, NULL}, + { "Node_isbest_get", _wrap_Node_isbest_get, METH_O, NULL}, + { "Node_alpha_get", _wrap_Node_alpha_get, METH_O, NULL}, + { "Node_beta_get", _wrap_Node_beta_get, METH_O, NULL}, + { "Node_prob_set", _wrap_Node_prob_set, METH_VARARGS, NULL}, + { "Node_prob_get", _wrap_Node_prob_get, METH_O, NULL}, + { "Node_wcost_get", _wrap_Node_wcost_get, METH_O, NULL}, + { "Node_cost_get", _wrap_Node_cost_get, METH_O, NULL}, + { "Node_surface_get", _wrap_Node_surface_get, METH_O, NULL}, + { "Node_swigregister", Node_swigregister, METH_O, NULL}, + { "Lattice_clear", _wrap_Lattice_clear, METH_O, NULL}, + { "Lattice_is_available", _wrap_Lattice_is_available, METH_O, NULL}, + { "Lattice_bos_node", _wrap_Lattice_bos_node, METH_O, NULL}, + { "Lattice_eos_node", _wrap_Lattice_eos_node, METH_O, NULL}, + { "Lattice_end_nodes", _wrap_Lattice_end_nodes, METH_VARARGS, NULL}, + { "Lattice_begin_nodes", _wrap_Lattice_begin_nodes, METH_VARARGS, NULL}, + { "Lattice_sentence", _wrap_Lattice_sentence, METH_O, NULL}, + { "Lattice_size", _wrap_Lattice_size, METH_O, NULL}, + { "Lattice_set_Z", _wrap_Lattice_set_Z, METH_VARARGS, NULL}, + { "Lattice_Z", _wrap_Lattice_Z, METH_O, NULL}, + { "Lattice_set_theta", _wrap_Lattice_set_theta, METH_VARARGS, NULL}, + { "Lattice_theta", _wrap_Lattice_theta, METH_O, NULL}, + { "Lattice_next", _wrap_Lattice_next, METH_O, NULL}, + { "Lattice_request_type", _wrap_Lattice_request_type, METH_O, NULL}, + { "Lattice_has_request_type", _wrap_Lattice_has_request_type, METH_VARARGS, NULL}, + { "Lattice_set_request_type", _wrap_Lattice_set_request_type, METH_VARARGS, NULL}, + { "Lattice_add_request_type", _wrap_Lattice_add_request_type, METH_VARARGS, NULL}, + { "Lattice_remove_request_type", _wrap_Lattice_remove_request_type, METH_VARARGS, NULL}, + { "Lattice_newNode", _wrap_Lattice_newNode, METH_O, NULL}, + { "Lattice_toString", _wrap_Lattice_toString, METH_VARARGS, NULL}, + { "Lattice_enumNBestAsString", _wrap_Lattice_enumNBestAsString, METH_VARARGS, NULL}, + { "Lattice_has_constraint", _wrap_Lattice_has_constraint, METH_O, NULL}, + { "Lattice_boundary_constraint", _wrap_Lattice_boundary_constraint, METH_VARARGS, NULL}, + { "Lattice_feature_constraint", _wrap_Lattice_feature_constraint, METH_VARARGS, NULL}, + { "Lattice_set_boundary_constraint", _wrap_Lattice_set_boundary_constraint, METH_VARARGS, NULL}, + { "Lattice_set_feature_constraint", _wrap_Lattice_set_feature_constraint, METH_VARARGS, NULL}, + { "Lattice_set_result", _wrap_Lattice_set_result, METH_VARARGS, NULL}, + { "Lattice_what", _wrap_Lattice_what, METH_O, NULL}, + { "Lattice_set_what", _wrap_Lattice_set_what, METH_VARARGS, NULL}, + { "delete_Lattice", _wrap_delete_Lattice, METH_O, NULL}, + { "new_Lattice", _wrap_new_Lattice, METH_NOARGS, NULL}, + { "Lattice_set_sentence", _wrap_Lattice_set_sentence, METH_VARARGS, NULL}, + { "Lattice_swigregister", Lattice_swigregister, METH_O, NULL}, + { "Lattice_swiginit", Lattice_swiginit, METH_VARARGS, NULL}, + { "Model_dictionary_info", _wrap_Model_dictionary_info, METH_O, NULL}, + { "Model_transition_cost", _wrap_Model_transition_cost, METH_VARARGS, NULL}, + { "Model_lookup", _wrap_Model_lookup, METH_VARARGS, NULL}, + { "Model_createTagger", _wrap_Model_createTagger, METH_O, NULL}, + { "Model_createLattice", _wrap_Model_createLattice, METH_O, NULL}, + { "Model_swap", _wrap_Model_swap, METH_VARARGS, NULL}, + { "Model_version", _wrap_Model_version, METH_NOARGS, NULL}, + { "delete_Model", _wrap_delete_Model, METH_O, NULL}, + { "new_Model", _wrap_new_Model, METH_VARARGS, NULL}, + { "Model_swigregister", Model_swigregister, METH_O, NULL}, + { "Model_swiginit", Model_swiginit, METH_VARARGS, NULL}, + { "Tagger_parse", _wrap_Tagger_parse, METH_VARARGS, NULL}, + { "Tagger_parseToNode", _wrap_Tagger_parseToNode, METH_VARARGS, NULL}, + { "Tagger_parseNBest", _wrap_Tagger_parseNBest, METH_VARARGS, NULL}, + { "Tagger_parseNBestInit", _wrap_Tagger_parseNBestInit, METH_VARARGS, NULL}, + { "Tagger_nextNode", _wrap_Tagger_nextNode, METH_O, NULL}, + { "Tagger_next", _wrap_Tagger_next, METH_O, NULL}, + { "Tagger_formatNode", _wrap_Tagger_formatNode, METH_VARARGS, NULL}, + { "Tagger_set_request_type", _wrap_Tagger_set_request_type, METH_VARARGS, NULL}, + { "Tagger_request_type", _wrap_Tagger_request_type, METH_O, NULL}, + { "Tagger_partial", _wrap_Tagger_partial, METH_O, NULL}, + { "Tagger_set_partial", _wrap_Tagger_set_partial, METH_VARARGS, NULL}, + { "Tagger_lattice_level", _wrap_Tagger_lattice_level, METH_O, NULL}, + { "Tagger_set_lattice_level", _wrap_Tagger_set_lattice_level, METH_VARARGS, NULL}, + { "Tagger_all_morphs", _wrap_Tagger_all_morphs, METH_O, NULL}, + { "Tagger_set_all_morphs", _wrap_Tagger_set_all_morphs, METH_VARARGS, NULL}, + { "Tagger_set_theta", _wrap_Tagger_set_theta, METH_VARARGS, NULL}, + { "Tagger_theta", _wrap_Tagger_theta, METH_O, NULL}, + { "Tagger_dictionary_info", _wrap_Tagger_dictionary_info, METH_O, NULL}, + { "Tagger_what", _wrap_Tagger_what, METH_O, NULL}, + { "delete_Tagger", _wrap_delete_Tagger, METH_O, NULL}, + { "Tagger_version", _wrap_Tagger_version, METH_NOARGS, NULL}, + { "new_Tagger", _wrap_new_Tagger, METH_VARARGS, NULL}, + { "Tagger_parseToString", _wrap_Tagger_parseToString, METH_VARARGS, NULL}, + { "Tagger_swigregister", Tagger_swigregister, METH_O, NULL}, + { "Tagger_swiginit", Tagger_swiginit, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + +static PyMethodDef SwigMethods_proxydocs[] = { { NULL, NULL, 0, NULL } }; @@ -7704,7 +7416,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 +7426,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 +7436,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 +7446,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 +7459,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 +7480,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 +7514,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 +7533,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 */ @@ -7855,7 +7557,7 @@ SWIG_InitializeModule(void *clientdata) { /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; @@ -7863,7 +7565,7 @@ SWIG_InitializeModule(void *clientdata) { swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ @@ -7938,7 +7640,7 @@ SWIG_InitializeModule(void *clientdata) { for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; @@ -8060,17 +7762,6 @@ extern "C" { return str; } - SWIGINTERN int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - char *tmp; - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); - SWIG_Python_str_DelForPy3(tmp); - Py_DECREF(str); - return 0; - } - SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v) { swig_globalvar *var = v->vars; @@ -8094,7 +7785,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 +7802,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,18 +7814,17 @@ 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 PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - (char *)"swigvarlink", /* tp_name */ + "swigvarlink", /* tp_name */ sizeof(swig_varlinkobject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc) swig_varlink_getattr, /* tp_getattr */ (setattrfunc) swig_varlink_setattr, /* tp_setattr */ 0, /* tp_compare */ @@ -8154,27 +7844,30 @@ extern "C" { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ #endif }; varlink_type = tmp; type_init = 1; -#if PY_VERSION_HEX < 0x02020000 - varlink_type.ob_type = &PyType_Type; -#else if (PyType_Ready(&varlink_type) < 0) return NULL; -#endif } return &varlink_type; } @@ -8190,14 +7883,14 @@ extern "C" { } SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { swig_varlinkobject *v = (swig_varlinkobject *) p; swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); if (gv) { size_t size = strlen(name)+1; gv->name = (char *)malloc(size); if (gv->name) { - strncpy(gv->name,name,size); + memcpy(gv->name, name, size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; @@ -8208,9 +7901,11 @@ extern "C" { SWIGINTERN PyObject * SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; + static PyObject *globals = 0; + if (!globals) { + globals = SWIG_newvarlink(); + } + return globals; } /* ----------------------------------------------------------------------------- @@ -8253,7 +7948,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; @@ -8274,9 +7971,9 @@ extern "C" { char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); + memcpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); + memcpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; @@ -8287,6 +7984,64 @@ extern "C" { } } + /* ----------------------------------------------------------------------------- + * Method creation and docstring support functions + * ----------------------------------------------------------------------------- */ + + /* ----------------------------------------------------------------------------- + * Function to find the method definition with the correct docstring for the + * proxy module as opposed to the low-level API + * ----------------------------------------------------------------------------- */ + + SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { + /* Find the function in the modified method table */ + size_t offset = 0; + int found = 0; + while (SwigMethods_proxydocs[offset].ml_meth != NULL) { + if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { + found = 1; + break; + } + offset++; + } + /* Use the copy with the modified docstring if available */ + return found ? &SwigMethods_proxydocs[offset] : NULL; + } + + /* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + + SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { + if (PyCFunction_Check(func)) { + PyCFunctionObject *funcobj = (PyCFunctionObject *)func; + PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return PyMethod_New(func, NULL, NULL); +#endif + } + + /* ----------------------------------------------------------------------------- + * Wrapper of PyStaticMethod_New() + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + + SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { + if (PyCFunction_Check(func)) { + PyCFunctionObject *funcobj = (PyCFunctionObject *)func; + PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } + return PyStaticMethod_New(func); + } + #ifdef __cplusplus } #endif @@ -8306,20 +8061,12 @@ PyObject* void #endif SWIG_init(void) { - PyObject *m, *d, *md; + PyObject *m, *d, *md, *globals; + #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, + SWIG_name, NULL, -1, SwigMethods, @@ -8338,23 +8085,24 @@ SWIG_init(void) { (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL }; static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own + SwigPyObject_own, + 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; + 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 +8110,21 @@ 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 + + (void)globals; + + /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ + SWIG_This(); + SWIG_Python_TypeCache(); + SwigPyPacked_type(); +#ifndef SWIGPYTHON_BUILTIN + SwigPyObject_type(); #endif /* Fix SwigMethods to carry the callback ptrs when needed */ @@ -8379,20 +8133,24 @@ SWIG_init(void) { #if PY_VERSION_HEX >= 0x03000000 m = PyModule_Create(&SWIG_module); #else - m = Py_InitModule((char *) SWIG_name, SwigMethods); + m = Py_InitModule(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/ruby/MeCab_wrap.cpp b/mecab/ruby/MeCab_wrap.cpp index efdf3a7..878d49c 100644 --- a/mecab/ruby/MeCab_wrap.cpp +++ b/mecab/ruby/MeCab_wrap.cpp @@ -1,14 +1,18 @@ /* ---------------------------------------------------------------------------- * 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 4.0.2 + * + * 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 SWIGRUBY #define SWIGRUBY +#endif + #ifdef __cplusplus @@ -65,28 +69,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 @@ -101,9 +105,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 @@ -129,7 +135,7 @@ template T SwigValueInit() { # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL -# endif +# endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ @@ -142,6 +148,19 @@ 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 /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable @@ -174,28 +193,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 @@ -210,9 +229,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 @@ -238,7 +259,7 @@ template T SwigValueInit() { # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL -# endif +# endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ @@ -251,6 +272,19 @@ 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 /* ----------------------------------------------------------------------------- * swigrun.swg @@ -276,7 +310,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. */ @@ -297,21 +331,22 @@ template T SwigValueInit() { /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 /* Flags for new pointer objects */ #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) { @@ -344,23 +379,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 @@ -374,17 +409,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) @@ -415,14 +450,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 @@ -466,7 +501,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. @@ -486,18 +521,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; @@ -505,24 +540,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 */ @@ -550,7 +574,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 * @@ -585,7 +609,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 * @@ -629,7 +653,7 @@ SWIG_TypePrettyName(const swig_type_info *type) { return type->name; } -/* +/* Set the clientdata field for a type */ SWIGRUNTIME void @@ -637,14 +661,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; } } @@ -653,31 +677,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) { @@ -702,14 +726,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); @@ -720,7 +744,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]; @@ -728,56 +752,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 * @@ -837,18 +861,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 @@ -946,42 +970,53 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #ifndef RSTRUCT_PTR # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr #endif +#ifndef RTYPEDDATA_P +# define RTYPEDDATA_P(x) (TYPE(x) != T_DATA) +#endif /* - * Need to be very careful about how these macros are defined, especially - * when compiling C++ code or C code with an ANSI C compiler. + * The following macros are used for providing the correct type of a + * function pointer to the Ruby C API. + * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being + * defined) these macros act transparently due to Ruby's moving away from + * ANYARGS and instead employing strict function signatures. + * + * Note: In case of C (not C++) the macros are transparent even before + * Ruby 2.7 due to the fact that the Ruby C API used function declarators + * with empty parentheses, which allows for an unspecified number of + * arguments. + * + * PROTECTFUNC(f) is used for the function pointer argument of the Ruby + * C API function rb_protect(). * - * VALUEFUNC(f) is a macro used to typecast a C function that implements - * a Ruby method so that it can be passed as an argument to API functions - * like rb_define_method() and rb_define_singleton_method(). + * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API + * functions like rb_define_method() and rb_define_singleton_method(). * - * VOIDFUNC(f) is a macro used to typecast a C function that implements - * either the "mark" or "free" stuff for a Ruby Data object, so that it - * can be passed as an argument to API functions like Data_Wrap_Struct() + * VOIDFUNC(f) is used to typecast a C function that implements either + * the "mark" or "free" stuff for a Ruby Data object, so that it can be + * passed as an argument to Ruby C API functions like Data_Wrap_Struct() * and Data_Make_Struct(). + * + * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer + * argument(s) of Ruby C API functions like rb_define_virtual_variable(). + * + * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer + * argument(s) of Ruby C API functions like st_foreach(). */ - -#ifdef __cplusplus -# ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */ -# define PROTECTFUNC(f) ((VALUE (*)()) f) -# define VALUEFUNC(f) ((VALUE (*)()) f) -# define VOIDFUNC(f) ((void (*)()) f) -# else -# ifndef ANYARGS /* These definitions should work for Ruby 1.6 */ -# define PROTECTFUNC(f) ((VALUE (*)()) f) -# define VALUEFUNC(f) ((VALUE (*)()) f) -# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) -# else /* These definitions should work for Ruby 1.7+ */ -# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f) -# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f) -# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) -# endif -# endif +#if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL) +# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f) +# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f) +# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f) +# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f)) +# define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f)) #else +# define PROTECTFUNC(f) (f) # define VALUEFUNC(f) (f) # define VOIDFUNC(f) (f) +# define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f) +# define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f) #endif /* Don't use for expressions have side effect */ @@ -1169,7 +1204,7 @@ void Ruby_Format_OverloadedError( /* ----------------------------------------------------------------------------- * rubytracking.swg * - * This file contains support for tracking mappings from + * This file contains support for tracking mappings from * Ruby objects to C++ objects. This functionality is needed * to implement mark functions for Ruby's mark and sweep * garbage collector. @@ -1179,6 +1214,11 @@ void Ruby_Format_OverloadedError( extern "C" { #endif +#if !defined(ST_DATA_T_DEFINED) +/* Needs to be explicitly included for Ruby 1.8 and earlier */ +#include +#endif + /* Ruby 1.8 actually assumes the first case. */ #if SIZEOF_VOIDP == SIZEOF_LONG # define SWIG2NUM(v) LONG2NUM((unsigned long)v) @@ -1190,109 +1230,69 @@ extern "C" { # error sizeof(void*) is not the same as long or long long #endif - -/* Global Ruby hash table to store Trackings from C/C++ - structs to Ruby Objects. +/* Global hash table to store Trackings from C/C++ + structs to Ruby Objects. */ -static VALUE swig_ruby_trackings = Qnil; +static st_table* swig_ruby_trackings = NULL; + +static VALUE swig_ruby_trackings_count(ID id, VALUE *var) { + return SWIG2NUM(swig_ruby_trackings->num_entries); +} -/* Global variable that stores a reference to the ruby - hash table delete function. */ -static ID swig_ruby_hash_delete; -/* Setup a Ruby hash table to store Trackings */ +/* Setup a hash table to store Trackings */ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) { - /* Create a ruby hash table to store Trackings from C++ + /* Create a hash table to store Trackings from C++ objects to Ruby objects. */ - /* Try to see if some other .so has already created a + /* Try to see if some other .so has already created a tracking hash table, which we keep hidden in an instance var in the SWIG module. This is done to allow multiple DSOs to share the same tracking table. */ - ID trackings_id = rb_intern( "@__trackings__" ); + VALUE trackings_value = Qnil; + /* change the variable name so that we can mix modules + compiled with older SWIG's - this used to be called "@__trackings__" */ + ID trackings_id = rb_intern( "@__safetrackings__" ); VALUE verbose = rb_gv_get("VERBOSE"); rb_gv_set("VERBOSE", Qfalse); - swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id ); + trackings_value = rb_ivar_get( _mSWIG, trackings_id ); rb_gv_set("VERBOSE", verbose); - /* No, it hasn't. Create one ourselves */ - if ( swig_ruby_trackings == Qnil ) - { - swig_ruby_trackings = rb_hash_new(); - rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings ); - } - - /* Now store a reference to the hash table delete function - so that we only have to look it up once.*/ - swig_ruby_hash_delete = rb_intern("delete"); -} - -/* Get a Ruby number to reference a pointer */ -SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) { - /* We cast the pointer to an unsigned long - and then store a reference to it using - a Ruby number object. */ - - /* Convert the pointer to a Ruby number */ - return SWIG2NUM(ptr); -} - -/* Get a Ruby number to reference an object */ -SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) { - /* We cast the object to an unsigned long - and then store a reference to it using - a Ruby number object. */ - - /* Convert the Object to a Ruby number */ - return SWIG2NUM(object); -} - -/* Get a Ruby object from a previously stored reference */ -SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) { - /* The provided Ruby number object is a reference - to the Ruby object we want.*/ + /* The trick here is that we have to store the hash table + pointer in a Ruby variable. We do not want Ruby's GC to + treat this pointer as a Ruby object, so we convert it to + a Ruby numeric value. */ + if (trackings_value == Qnil) { + /* No, it hasn't. Create one ourselves */ + swig_ruby_trackings = st_init_numtable(); + rb_ivar_set( _mSWIG, trackings_id, SWIG2NUM(swig_ruby_trackings) ); + } else { + swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value); + } - /* Convert the Ruby number to a Ruby object */ - return NUM2SWIG(reference); + rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", + VALUEFUNC(swig_ruby_trackings_count), + SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL)); } /* Add a Tracking from a C/C++ struct to a Ruby object */ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) { - /* In a Ruby hash table we store the pointer and - the associated Ruby object. The trick here is - that we cannot store the Ruby object directly - if - we do then it cannot be garbage collected. So - instead we typecast it as a unsigned long and - convert it to a Ruby number object.*/ - - /* Get a reference to the pointer as a Ruby number */ - VALUE key = SWIG_RubyPtrToReference(ptr); - - /* Get a reference to the Ruby object as a Ruby number */ - VALUE value = SWIG_RubyObjectToReference(object); - /* Store the mapping to the global hash table. */ - rb_hash_aset(swig_ruby_trackings, key, value); + st_insert(swig_ruby_trackings, (st_data_t)ptr, object); } /* Get the Ruby object that owns the specified C/C++ struct */ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) { - /* Get a reference to the pointer as a Ruby number */ - VALUE key = SWIG_RubyPtrToReference(ptr); - /* Now lookup the value stored in the global hash table */ - VALUE value = rb_hash_aref(swig_ruby_trackings, key); - - if (value == Qnil) { - /* No object exists - return nil. */ + VALUE value; + + if (st_lookup(swig_ruby_trackings, (st_data_t)ptr, &value)) { + return value; + } else { return Qnil; } - else { - /* Convert this value to Ruby object */ - return SWIG_RubyReferenceToObject(value); - } } /* Remove a Tracking from a C/C++ struct to a Ruby object. It @@ -1300,25 +1300,39 @@ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) { since the same memory address may be reused later to create a new object. */ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) { - /* Get a reference to the pointer as a Ruby number */ - VALUE key = SWIG_RubyPtrToReference(ptr); - - /* Delete the object from the hash table by calling Ruby's - do this we need to call the Hash.delete method.*/ - rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key); + /* Delete the object from the hash table */ + st_delete(swig_ruby_trackings, (st_data_t *)&ptr, NULL); } /* This is a helper method that unlinks a Ruby object from its underlying C++ object. This is needed if the lifetime of the - Ruby object is longer than the C++ object */ + Ruby object is longer than the C++ object. */ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) { VALUE object = SWIG_RubyInstanceFor(ptr); if (object != Qnil) { + // object might have the T_ZOMBIE type, but that's just + // because the GC has flagged it as such for a deferred + // destruction. Until then, it's still a T_DATA object. DATA_PTR(object) = 0; } } +/* This is a helper method that iterates over all the trackings + passing the C++ object pointer and its related Ruby object + to the passed callback function. */ + +/* Proxy method to abstract the internal trackings datatype */ +static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) { + ((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj); + return ST_CONTINUE; +} + +SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) { + st_foreach(swig_ruby_trackings, + SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback), + (st_data_t)meth); +} #ifdef __cplusplus } @@ -1377,7 +1391,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) { #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own) #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags) #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own) -#define swig_owntype ruby_owntype +#define swig_owntype swig_ruby_owntype /* for raw packed data */ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags) @@ -1398,7 +1412,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) { /* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule() +#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer) @@ -1514,14 +1528,13 @@ SWIG_Ruby_InitRuntime(void) SWIGRUNTIME void SWIG_Ruby_define_class(swig_type_info *type) { - VALUE klass; char *klass_name = (char *) malloc(4 + strlen(type->name) + 1); sprintf(klass_name, "TYPE%s", type->name); if (NIL_P(_cSWIG_Pointer)) { _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject); rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new"); } - klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); + rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer); free((void *) klass_name); } @@ -1535,10 +1548,11 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) swig_class *sklass; VALUE klass; VALUE obj; - + if (!ptr) return Qnil; - + + assert(type); if (type->clientdata) { sklass = (swig_class *) type->clientdata; @@ -1546,13 +1560,13 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) track = sklass->trackObjects; if (track) { obj = SWIG_RubyInstanceFor(ptr); - + /* Check the object's type and make sure it has the correct type. It might not in cases where methods do things like downcast methods. */ if (obj != Qnil) { VALUE value = rb_iv_get(obj, "@__swigtype__"); - char* type_name = RSTRING_PTR(value); + const char* type_name = RSTRING_PTR(value); if (strcmp(type->name, type_name) == 0) { return obj; @@ -1578,7 +1592,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags) obj = Data_Wrap_Struct(klass, 0, 0, ptr); } rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name)); - + return obj; } @@ -1598,26 +1612,30 @@ SWIGRUNTIMEINLINE char * SWIG_Ruby_MangleStr(VALUE obj) { VALUE stype = rb_iv_get(obj, "@__swigtype__"); + if (NIL_P(stype)) + return NULL; return StringValuePtr(stype); } /* Acquire a pointer value */ -typedef void (*ruby_owntype)(void*); - -SWIGRUNTIME ruby_owntype -SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) { - if (obj) { - ruby_owntype oldown = RDATA(obj)->dfree; - RDATA(obj)->dfree = own; - return oldown; - } else { - return 0; +typedef struct { + void (*datafree)(void *); + int own; +} swig_ruby_owntype; + +SWIGRUNTIME swig_ruby_owntype +SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) { + swig_ruby_owntype oldown = {0, 0}; + if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) { + oldown.datafree = RDATA(obj)->dfree; + RDATA(obj)->dfree = own.datafree; } + return oldown; } /* Convert a pointer value */ SWIGRUNTIME int -SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own) +SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own) { char *c; swig_cast_info *tc; @@ -1625,16 +1643,20 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, /* Grab the pointer */ if (NIL_P(obj)) { - *ptr = 0; - return SWIG_OK; + if (ptr) + *ptr = 0; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } else { - if (TYPE(obj) != T_DATA) { + if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) { return SWIG_ERROR; } Data_Get_Struct(obj, void, vptr); } - if (own) *own = RDATA(obj)->dfree; + if (own) { + own->datafree = RDATA(obj)->dfree; + own->own = 0; + } /* Check to see if the input object is giving up ownership of the underlying C struct or C++ object. If so then we @@ -1669,8 +1691,6 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, /* The object has already been deleted */ return SWIG_ObjectPreviouslyDeletedError; } - *ptr = vptr; - return SWIG_OK; } } if ((c = SWIG_MangleStr(obj)) == NULL) { @@ -1680,12 +1700,23 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, if (!tc) { return SWIG_ERROR; } else { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc, vptr, &newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ + if (ptr) { + if (tc->type == ty) { + *ptr = vptr; + } else { + 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 = own->own | SWIG_CAST_NEW_MEMORY; + } + } + } } } else { - *ptr = vptr; + if (ptr) + *ptr = vptr; } return SWIG_OK; @@ -1711,7 +1742,7 @@ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) { return rb_str_new2(result); } -/* Convert a packed value value */ +/* Convert a packed pointer value */ SWIGRUNTIME int SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) { swig_cast_info *tc; @@ -1734,7 +1765,7 @@ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) { } SWIGRUNTIME swig_module_info * -SWIG_Ruby_GetModule(void) +SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata)) { VALUE pointer; swig_module_info *ret = 0; @@ -1774,7 +1805,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer) SWIGINTERN int SWIG_Ruby_isCallable( VALUE proc ) { - if ( rb_respond_to( proc, swig_call_id ) == Qtrue ) + if ( rb_respond_to( proc, swig_call_id ) ) return 1; return 0; } @@ -1787,7 +1818,7 @@ int SWIG_Ruby_isCallable( VALUE proc ) SWIGINTERN int SWIG_Ruby_arity( VALUE proc, int minimal ) { - if ( rb_respond_to( proc, swig_arity_id ) == Qtrue ) + if ( rb_respond_to( proc, swig_arity_id ) ) { VALUE num = rb_funcall( proc, swig_arity_id, 0 ); int arity = NUM2INT(num); @@ -1824,9 +1855,8 @@ int SWIG_Ruby_arity( VALUE proc, int minimal ) #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) @@ -1841,7 +1871,7 @@ static VALUE mMeCab; #define SWIG_RUBY_THREAD_END_BLOCK -#define SWIGVERSION 0x020004 +#define SWIGVERSION 0x040002 #define SWIG_VERSION SWIGVERSION @@ -2005,20 +2035,68 @@ SWIG_From_unsigned_SS_short (unsigned short 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(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# elif defined(__clang__) && defined(__has_builtin) +# if __has_builtin(__builtin_isfinite) +# define SWIG_isfinite(X) (__builtin_isfinite(X)) +# endif +# 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 VALUE -SWIG_ruby_failed(void) +SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2)) { return Qnil; } -/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ -SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args) +/*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ +SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE arg) { + VALUE *args = (VALUE *)arg; VALUE obj = args[0]; VALUE type = TYPE(obj); double *res = (double *)(args[1]); - *res = NUM2DBL(obj); + *res = NUM2DBL(obj); (void)type; return obj; } /*@SWIG@*/ @@ -2032,7 +2110,7 @@ SWIG_AsVal_double (VALUE obj, double *val) VALUE a[2]; a[0] = obj; a[1] = (VALUE)(&v); - if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) { + if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { if (val) *val = v; return SWIG_OK; } @@ -2047,7 +2125,7 @@ SWIG_AsVal_float (VALUE 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); @@ -2088,9 +2166,10 @@ SWIG_From_bool (bool value) } -/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ -SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args) +/*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ +SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE arg) { + VALUE *args = (VALUE *)arg; VALUE obj = args[0]; VALUE type = TYPE(obj); unsigned long *res = (unsigned long *)(args[1]); @@ -2108,7 +2187,7 @@ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val) VALUE a[2]; a[0] = obj; a[1] = (VALUE)(&v); - if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) { + if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { if (val) *val = v; return SWIG_OK; } @@ -2117,26 +2196,93 @@ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val) } +#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) +# define SWIG_LONG_LONG_AVAILABLE +#endif + + +#ifdef SWIG_LONG_LONG_AVAILABLE +/*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ +SWIGINTERN VALUE SWIG_AUX_NUM2ULL(VALUE arg) +{ + VALUE *args = (VALUE *)arg; + VALUE obj = args[0]; + VALUE type = TYPE(obj); + long long *res = (long long *)(args[1]); + *res = type == T_FIXNUM ? NUM2ULL(obj) : rb_big2ull(obj); + return obj; +} +/*@SWIG@*/ + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long_SS_long (VALUE obj, unsigned long long *val) +{ + VALUE type = TYPE(obj); + if ((type == T_FIXNUM) || (type == T_BIGNUM)) { + unsigned long long v; + VALUE a[2]; + a[0] = obj; + a[1] = (VALUE)(&v); + if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { + if (val) *val = v; + return SWIG_OK; + } + } + return SWIG_TypeError; +} +#endif + + SWIGINTERNINLINE int SWIG_AsVal_size_t (VALUE 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; } +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERNINLINE VALUE +SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) +{ + return ULL2NUM(value); +} +#endif + + SWIGINTERNINLINE VALUE SWIG_From_size_t (size_t value) { - return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(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 } -/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ -SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args) +/*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/ +SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg) { + VALUE *args = (VALUE *)arg; VALUE obj = args[0]; VALUE type = TYPE(obj); long *res = (long *)(args[1]); @@ -2154,7 +2300,7 @@ SWIG_AsVal_long (VALUE obj, long* val) VALUE a[2]; a[0] = obj; a[1] = (VALUE)(&v); - if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) { + if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) { if (val) *val = v; return SWIG_OK; } @@ -2183,16 +2329,12 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc) { if (TYPE(obj) == T_STRING) { - #if defined(StringValuePtr) char *cstr = StringValuePtr(obj); - #else - char *cstr = STR2CSTR(obj); - #endif size_t size = RSTRING_LEN(obj) + 1; if (cptr) { if (alloc) { if (*alloc == SWIG_NEWOBJ) { - *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); + *cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size))); } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; @@ -2262,7 +2404,7 @@ SWIG_AsVal_bool (VALUE obj, bool *val) SWIGINTERN char const *MeCab_Tagger_parseToString__SWIG_0(MeCab::Tagger *self,char const *str,size_t length=0){ return self->parse(str, length); } -swig_class SwigClassDictionaryInfo; +static swig_class SwigClassDictionaryInfo; SWIGINTERN VALUE _wrap_DictionaryInfo_filename_get(int argc, VALUE *argv, VALUE self) { @@ -2312,7 +2454,6 @@ _wrap_DictionaryInfo_charset_get(int argc, VALUE *argv, VALUE self) { } - /* Document-method: MeCab::DictionaryInfo.size @@ -2465,22 +2606,20 @@ _wrap_DictionaryInfo_next_get(int argc, VALUE *argv, VALUE self) { } -#ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE -_wrap_DictionaryInfo_allocate(VALUE self) { +#ifdef HAVE_RB_DEFINE_ALLOC_FUNC +_wrap_DictionaryInfo_allocate(VALUE self) #else - SWIGINTERN VALUE - _wrap_DictionaryInfo_allocate(int argc, VALUE *argv, VALUE self) { +_wrap_DictionaryInfo_allocate(int argc, VALUE *argv, VALUE self) #endif - - - VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_mecab_dictionary_info_t); +{ + VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_mecab_dictionary_info_t); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC - rb_obj_call_init(vresult, argc, argv); + rb_obj_call_init(vresult, argc, argv); #endif - return vresult; - } - + return vresult; +} + SWIGINTERN VALUE _wrap_new_DictionaryInfo(int argc, VALUE *argv, VALUE self) { @@ -2508,11 +2647,12 @@ _wrap_new_DictionaryInfo(int argc, VALUE *argv, VALUE self) { SWIGINTERN void -free_mecab_dictionary_info_t(mecab_dictionary_info_t *arg1) { +free_mecab_dictionary_info_t(void *self) { + mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *)self; delete arg1; } -swig_class SwigClassPath; +static swig_class SwigClassPath; SWIGINTERN VALUE _wrap_Path_rnode_get(int argc, VALUE *argv, VALUE self) { @@ -2687,7 +2827,7 @@ _wrap_Path_prob_get(int argc, VALUE *argv, VALUE self) { } -swig_class SwigClassNode; +static swig_class SwigClassNode; SWIGINTERN VALUE _wrap_Node_prev_get(int argc, VALUE *argv, VALUE self) { @@ -3257,7 +3397,7 @@ _wrap_Node_surface_get(int argc, VALUE *argv, VALUE self) { } -swig_class SwigClassLattice; +static swig_class SwigClassLattice; SWIGINTERN VALUE _wrap_Lattice_clear(int argc, VALUE *argv, VALUE self) { @@ -3510,7 +3650,6 @@ _wrap_Lattice_sentence(int argc, VALUE *argv, VALUE self) { } - /* Document-method: MeCab::Lattice.size @@ -4073,7 +4212,7 @@ SWIGINTERN VALUE _wrap_Lattice_toString(int nargs, VALUE *args, VALUE self) { fail: Ruby_Format_OverloadedError( argc, 3, "Lattice.toString", - " char const * Lattice.toString()\n" + " char const Lattice.toString()\n" " char const * Lattice.toString(MeCab::Node const *node)\n"); return Qnil; @@ -4464,26 +4603,25 @@ _wrap_Lattice_set_what(int argc, VALUE *argv, VALUE self) { SWIGINTERN void -free_MeCab_Lattice(MeCab::Lattice *arg1) { +free_MeCab_Lattice(void *self) { + MeCab::Lattice *arg1 = (MeCab::Lattice *)self; delete arg1; } -#ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE -_wrap_Lattice_allocate(VALUE self) { +#ifdef HAVE_RB_DEFINE_ALLOC_FUNC +_wrap_Lattice_allocate(VALUE self) #else - SWIGINTERN VALUE - _wrap_Lattice_allocate(int argc, VALUE *argv, VALUE self) { +_wrap_Lattice_allocate(int argc, VALUE *argv, VALUE self) #endif - - - VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_MeCab__Lattice); +{ + VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_MeCab__Lattice); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC - rb_obj_call_init(vresult, argc, argv); + rb_obj_call_init(vresult, argc, argv); #endif - return vresult; - } - + return vresult; +} + SWIGINTERN VALUE _wrap_new_Lattice(int argc, VALUE *argv, VALUE self) { @@ -4552,7 +4690,7 @@ _wrap_Lattice_set_sentence(int argc, VALUE *argv, VALUE self) { } -swig_class SwigClassModel; +static swig_class SwigClassModel; SWIGINTERN VALUE _wrap_Model_dictionary_info(int argc, VALUE *argv, VALUE self) { @@ -4729,7 +4867,7 @@ _wrap_Model_createTagger(int argc, VALUE *argv, VALUE self) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); + vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; @@ -4763,7 +4901,7 @@ _wrap_Model_createLattice(int argc, VALUE *argv, VALUE self) { SWIG_exception (SWIG_RuntimeError, (char*)e); } } - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, 0 | 0 ); + vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, SWIG_POINTER_OWN | 0 ); return vresult; fail: return Qnil; @@ -4839,132 +4977,11 @@ _wrap_Model_version(int argc, VALUE *argv, VALUE self) { SWIGINTERN void -free_MeCab_Model(MeCab::Model *arg1) { +free_MeCab_Model(void *self) { + MeCab::Model *arg1 = (MeCab::Model *)self; delete arg1; } -SWIGINTERN VALUE -_wrap_Model_create__SWIG_0(int argc, VALUE *argv, VALUE self) { - int arg1 ; - char **arg2 = (char **) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - MeCab::Model *result = 0 ; - VALUE vresult = Qnil; - - if ((argc < 2) || (argc > 2)) { - rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; - } - ecode1 = SWIG_AsVal_int(argv[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","MeCab::Model::create", 1, argv[0] )); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_p_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char **","MeCab::Model::create", 2, argv[1] )); - } - 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); - } - } - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | 0 ); - return vresult; -fail: - return Qnil; -} - - -SWIGINTERN VALUE -_wrap_Model_create__SWIG_1(int argc, VALUE *argv, VALUE self) { - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - MeCab::Model *result = 0 ; - VALUE vresult = Qnil; - - if ((argc < 1) || (argc > 1)) { - rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; - } - res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","MeCab::Model::create", 1, argv[0] )); - } - 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); - } - } - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return vresult; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return Qnil; -} - - -SWIGINTERN VALUE _wrap_Model_create(int nargs, VALUE *args, VALUE self) { - int argc; - VALUE argv[2]; - int ii; - - argc = nargs; - if (argc > 2) SWIG_fail; - for (ii = 0; (ii < argc); ++ii) { - argv[ii] = 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(nargs, args, self); - } - } - 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(nargs, args, self); - } - } - } - -fail: - Ruby_Format_OverloadedError( argc, 2, "Model.create", - " MeCab::Model * Model.create(int argc, char **argv)\n" - " MeCab::Model * Model.create(char const *arg)\n"); - - return Qnil; -} - - SWIGINTERN VALUE _wrap_new_Model__SWIG_0(int argc, VALUE *argv, VALUE self) { char *arg1 = (char *) 0 ; @@ -4978,7 +4995,7 @@ _wrap_new_Model__SWIG_0(int argc, VALUE *argv, VALUE self) { } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","MeCab::Model", 1, argv[0] )); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","Model", 1, argv[0] )); } arg1 = reinterpret_cast< char * >(buf1); { @@ -5001,22 +5018,20 @@ _wrap_new_Model__SWIG_0(int argc, VALUE *argv, VALUE self) { } -#ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE -_wrap_Model_allocate(VALUE self) { +#ifdef HAVE_RB_DEFINE_ALLOC_FUNC +_wrap_Model_allocate(VALUE self) #else - SWIGINTERN VALUE - _wrap_Model_allocate(int argc, VALUE *argv, VALUE self) { +_wrap_Model_allocate(int argc, VALUE *argv, VALUE self) #endif - - - VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_MeCab__Model); +{ + VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_MeCab__Model); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC - rb_obj_call_init(vresult, argc, argv); + rb_obj_call_init(vresult, argc, argv); #endif - return vresult; - } - + return vresult; +} + SWIGINTERN VALUE _wrap_new_Model__SWIG_1(int argc, VALUE *argv, VALUE self) { @@ -5074,7 +5089,7 @@ SWIGINTERN VALUE _wrap_new_Model(int nargs, VALUE *args, VALUE self) { } -swig_class SwigClassTagger; +static swig_class SwigClassTagger; SWIGINTERN VALUE _wrap_Tagger_parse__SWIG_0(int argc, VALUE *argv, VALUE self) { @@ -5222,7 +5237,7 @@ SWIGINTERN VALUE _wrap_Tagger_parse(int nargs, VALUE *args, VALUE self) { if (argc == 2) { int _v; void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Model, 0); + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_MeCab__Model, SWIG_POINTER_NO_NULL); _v = SWIG_CheckState(res); if (_v) { void *vptr = 0; @@ -5263,8 +5278,8 @@ SWIGINTERN VALUE _wrap_Tagger_parse(int nargs, VALUE *args, VALUE self) { fail: Ruby_Format_OverloadedError( argc, 3, "Tagger.parse", - " char const * Tagger.parse(MeCab::Lattice *lattice)\n" - " char const * Tagger.parse(MeCab::Lattice *lattice)\n" + " bool Tagger.parse(MeCab::Lattice *lattice)\n" + " bool Tagger.parse(MeCab::Lattice *lattice)\n" " char const * Tagger.parse(char const *str)\n"); return Qnil; @@ -5958,132 +5973,11 @@ _wrap_Tagger_what(int argc, VALUE *argv, VALUE self) { SWIGINTERN void -free_MeCab_Tagger(MeCab::Tagger *arg1) { +free_MeCab_Tagger(void *self) { + MeCab::Tagger *arg1 = (MeCab::Tagger *)self; delete arg1; } -SWIGINTERN VALUE -_wrap_Tagger_create__SWIG_0(int argc, VALUE *argv, VALUE self) { - int arg1 ; - char **arg2 = (char **) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - MeCab::Tagger *result = 0 ; - VALUE vresult = Qnil; - - if ((argc < 2) || (argc > 2)) { - rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; - } - ecode1 = SWIG_AsVal_int(argv[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","MeCab::Tagger::create", 1, argv[0] )); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_p_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char **","MeCab::Tagger::create", 2, argv[1] )); - } - 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); - } - } - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); - return vresult; -fail: - return Qnil; -} - - -SWIGINTERN VALUE -_wrap_Tagger_create__SWIG_1(int argc, VALUE *argv, VALUE self) { - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - MeCab::Tagger *result = 0 ; - VALUE vresult = Qnil; - - if ((argc < 1) || (argc > 1)) { - rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail; - } - res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","MeCab::Tagger::create", 1, argv[0] )); - } - 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); - } - } - vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return vresult; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return Qnil; -} - - -SWIGINTERN VALUE _wrap_Tagger_create(int nargs, VALUE *args, VALUE self) { - int argc; - VALUE argv[2]; - int ii; - - argc = nargs; - if (argc > 2) SWIG_fail; - for (ii = 0; (ii < argc); ++ii) { - argv[ii] = 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(nargs, args, self); - } - } - 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(nargs, args, self); - } - } - } - -fail: - Ruby_Format_OverloadedError( argc, 2, "Tagger.create", - " MeCab::Tagger * Tagger.create(int argc, char **argv)\n" - " MeCab::Tagger * Tagger.create(char const *arg)\n"); - - return Qnil; -} - - SWIGINTERN VALUE _wrap_Tagger_version(int argc, VALUE *argv, VALUE self) { char *result = 0 ; @@ -6123,7 +6017,7 @@ _wrap_new_Tagger__SWIG_0(int argc, VALUE *argv, VALUE self) { } res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","MeCab::Tagger", 1, argv[0] )); + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","Tagger", 1, argv[0] )); } arg1 = reinterpret_cast< char * >(buf1); { @@ -6146,22 +6040,20 @@ _wrap_new_Tagger__SWIG_0(int argc, VALUE *argv, VALUE self) { } -#ifdef HAVE_RB_DEFINE_ALLOC_FUNC SWIGINTERN VALUE -_wrap_Tagger_allocate(VALUE self) { +#ifdef HAVE_RB_DEFINE_ALLOC_FUNC +_wrap_Tagger_allocate(VALUE self) #else - SWIGINTERN VALUE - _wrap_Tagger_allocate(int argc, VALUE *argv, VALUE self) { +_wrap_Tagger_allocate(int argc, VALUE *argv, VALUE self) #endif - - - VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_MeCab__Tagger); +{ + VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_MeCab__Tagger); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC - rb_obj_call_init(vresult, argc, argv); + rb_obj_call_init(vresult, argc, argv); #endif - return vresult; - } - + return vresult; +} + SWIGINTERN VALUE _wrap_new_Tagger__SWIG_1(int argc, VALUE *argv, VALUE self) { @@ -6363,7 +6255,7 @@ SWIGINTERN VALUE _wrap_Tagger_parseToString(int nargs, VALUE *args, VALUE self) fail: Ruby_Format_OverloadedError( argc, 4, "parseToString", - " char const * parseToString(char const *str, size_t length)\n" + " char const parseToString(char const *str, size_t length)\n" " char const * parseToString(char const *str)\n"); return Qnil; @@ -6381,7 +6273,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, @@ -6392,7 +6283,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}}; @@ -6403,7 +6293,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, @@ -6414,7 +6303,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, }; @@ -6422,18 +6310,18 @@ static swig_cast_info *swig_cast_initial[] = { /* ----------------------------------------------------------------------------- * 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 @@ -6443,17 +6331,17 @@ static swig_cast_info *swig_cast_initial[] = { * 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 @@ -6477,9 +6365,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) { @@ -6498,27 +6384,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 */ @@ -6526,15 +6408,15 @@ SWIG_InitializeModule(void *clientdata) { /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; swig_type_info *ret; swig_cast_info *cast; - + #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ @@ -6559,7 +6441,7 @@ SWIG_InitializeModule(void *clientdata) { /* Insert casting types */ cast = swig_module.cast_initial[i]; while (cast->type) { - + /* Don't need to add information already in the list */ ret = 0; #ifdef SWIGRUNTIME_DEBUG @@ -6610,7 +6492,7 @@ SWIG_InitializeModule(void *clientdata) { for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; @@ -6801,7 +6683,6 @@ SWIGEXPORT void Init_MeCab(void) { rb_define_method(SwigClassModel.klass, "createLattice", VALUEFUNC(_wrap_Model_createLattice), -1); rb_define_method(SwigClassModel.klass, "swap", VALUEFUNC(_wrap_Model_swap), -1); rb_define_singleton_method(SwigClassModel.klass, "version", VALUEFUNC(_wrap_Model_version), -1); - rb_define_singleton_method(SwigClassModel.klass, "create", VALUEFUNC(_wrap_Model_create), -1); SwigClassModel.mark = 0; SwigClassModel.destroy = (void (*)(void *)) free_MeCab_Model; SwigClassModel.trackObjects = 0; @@ -6829,7 +6710,6 @@ SWIGEXPORT void Init_MeCab(void) { rb_define_method(SwigClassTagger.klass, "theta", VALUEFUNC(_wrap_Tagger_theta), -1); rb_define_method(SwigClassTagger.klass, "dictionary_info", VALUEFUNC(_wrap_Tagger_dictionary_info), -1); rb_define_method(SwigClassTagger.klass, "what", VALUEFUNC(_wrap_Tagger_what), -1); - rb_define_singleton_method(SwigClassTagger.klass, "create", VALUEFUNC(_wrap_Tagger_create), -1); rb_define_singleton_method(SwigClassTagger.klass, "version", VALUEFUNC(_wrap_Tagger_version), -1); rb_define_method(SwigClassTagger.klass, "parseToString", VALUEFUNC(_wrap_Tagger_parseToString), -1); SwigClassTagger.mark = 0;