cabocha 0.69

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f6b750b5eb161ca57674dfd974091a08233d4fb0
4
+ data.tar.gz: 1690ecbacd5ea1c3182412199dced342f7cc37ac
5
+ SHA512:
6
+ metadata.gz: 8f146b5bf816709918d44cc34c8072b422195f1c77927f5d06141788c0fb8dc1590ce20387ea2ff59702eb49558c9528e1c6a565663f19c426822e2bbf081f21
7
+ data.tar.gz: 5652e28a556dce9e9f60ceb3b620d65cdf35161cad8fad44058ed1fe2cacaa2b005ffea727e673d0990737f5a0718c1b10b126a574d79501067851003821225d
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /vendor/bundle/
3
+ /Gemfile.lock
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.bundle
10
+ *.so
11
+ *.o
12
+ *.a
13
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2015, Yasuaki Uechi <uetchy@randompaper.co>
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+
8
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+
10
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,40 @@
1
+ # cabocha-ruby
2
+
3
+ cabocha-ruby is a gem that provides Ruby bindings for CaboCha.
4
+ It is actually SWIG-generated files.
5
+
6
+ ## Usage
7
+
8
+ ```ruby
9
+ require 'cabocha' # or require 'CaboCha'
10
+
11
+ parser = CaboCha::Parser.new
12
+ ```
13
+
14
+ ## Install
15
+
16
+ cabocha-ruby pre-requires `CaboCha`. You __MUST__ install them beforehand.
17
+
18
+ ```console
19
+ $ gem install cabocha
20
+ ```
21
+
22
+ or, add this into __Gemfile__
23
+
24
+ ```ruby
25
+ gem "cabocha"
26
+ ```
27
+
28
+ And then execute:
29
+
30
+ ```console
31
+ $ bundle
32
+ ```
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork it ( https://github.com/uetchy/myo-ruby/fork )
37
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 4. Push to the branch (`git push origin my-new-feature`)
40
+ 5. Create a new Pull Request
@@ -0,0 +1,12 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rake/extensiontask'
4
+
5
+ Rake::ExtensionTask.new 'CaboCha' do |ext|
6
+ ext.lib_dir = 'lib/cabocha'
7
+ end
8
+
9
+ RSpec::Core::RakeTask.new(:spec)
10
+
11
+ task :default => :spec
12
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'cabocha'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'cabocha'
9
+ spec.version = CaboCha::VERSION
10
+ spec.authors = ['Yasuaki Uechi']
11
+ spec.email = ['uetchy@randompaper.co']
12
+ spec.summary = %q{cabocha-ruby is a gem that provides Ruby bindings for CaboCha.}
13
+ spec.homepage = 'https://github.com/uetchy/cabocha-ruby'
14
+ spec.license = 'New BSD'
15
+ spec.extensions = ['ext/cabocha/extconf.rb']
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_development_dependency 'bundler', '~> 1.8'
21
+ spec.add_development_dependency 'rake', '~> 10.4'
22
+ spec.add_development_dependency 'rspec'
23
+ spec.add_development_dependency 'rake-compiler'
24
+ spec.add_development_dependency 'pry-byebug'
25
+ end
@@ -0,0 +1,4462 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 2.0.11
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ #define SWIGRUBY
12
+
13
+
14
+ #ifdef __cplusplus
15
+ /* SwigValueWrapper is described in swig.swg */
16
+ template<typename T> class SwigValueWrapper {
17
+ struct SwigMovePointer {
18
+ T *ptr;
19
+ SwigMovePointer(T *p) : ptr(p) { }
20
+ ~SwigMovePointer() { delete ptr; }
21
+ SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
22
+ } pointer;
23
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
24
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
25
+ public:
26
+ SwigValueWrapper() : pointer(0) { }
27
+ SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
28
+ operator T&() const { return *pointer.ptr; }
29
+ T *operator&() { return pointer.ptr; }
30
+ };
31
+
32
+ template <typename T> T SwigValueInit() {
33
+ return T();
34
+ }
35
+ #endif
36
+
37
+ /* -----------------------------------------------------------------------------
38
+ * This section contains generic SWIG labels for method/variable
39
+ * declarations/attributes, and other compiler dependent labels.
40
+ * ----------------------------------------------------------------------------- */
41
+
42
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
43
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
44
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
45
+ # define SWIGTEMPLATEDISAMBIGUATOR template
46
+ # elif defined(__HP_aCC)
47
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
48
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
49
+ # define SWIGTEMPLATEDISAMBIGUATOR template
50
+ # else
51
+ # define SWIGTEMPLATEDISAMBIGUATOR
52
+ # endif
53
+ #endif
54
+
55
+ /* inline attribute */
56
+ #ifndef SWIGINLINE
57
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
58
+ # define SWIGINLINE inline
59
+ # else
60
+ # define SWIGINLINE
61
+ # endif
62
+ #endif
63
+
64
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
65
+ #ifndef SWIGUNUSED
66
+ # if defined(__GNUC__)
67
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
68
+ # define SWIGUNUSED __attribute__ ((__unused__))
69
+ # else
70
+ # define SWIGUNUSED
71
+ # endif
72
+ # elif defined(__ICC)
73
+ # define SWIGUNUSED __attribute__ ((__unused__))
74
+ # else
75
+ # define SWIGUNUSED
76
+ # endif
77
+ #endif
78
+
79
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
80
+ # if defined(_MSC_VER)
81
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
82
+ # endif
83
+ #endif
84
+
85
+ #ifndef SWIGUNUSEDPARM
86
+ # ifdef __cplusplus
87
+ # define SWIGUNUSEDPARM(p)
88
+ # else
89
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
90
+ # endif
91
+ #endif
92
+
93
+ /* internal SWIG method */
94
+ #ifndef SWIGINTERN
95
+ # define SWIGINTERN static SWIGUNUSED
96
+ #endif
97
+
98
+ /* internal inline SWIG method */
99
+ #ifndef SWIGINTERNINLINE
100
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
101
+ #endif
102
+
103
+ /* exporting methods */
104
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
105
+ # ifndef GCC_HASCLASSVISIBILITY
106
+ # define GCC_HASCLASSVISIBILITY
107
+ # endif
108
+ #endif
109
+
110
+ #ifndef SWIGEXPORT
111
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
112
+ # if defined(STATIC_LINKED)
113
+ # define SWIGEXPORT
114
+ # else
115
+ # define SWIGEXPORT __declspec(dllexport)
116
+ # endif
117
+ # else
118
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
119
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
120
+ # else
121
+ # define SWIGEXPORT
122
+ # endif
123
+ # endif
124
+ #endif
125
+
126
+ /* calling conventions for Windows */
127
+ #ifndef SWIGSTDCALL
128
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
129
+ # define SWIGSTDCALL __stdcall
130
+ # else
131
+ # define SWIGSTDCALL
132
+ # endif
133
+ #endif
134
+
135
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
136
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
137
+ # define _CRT_SECURE_NO_DEPRECATE
138
+ #endif
139
+
140
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
141
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
142
+ # define _SCL_SECURE_NO_DEPRECATE
143
+ #endif
144
+
145
+
146
+ /* -----------------------------------------------------------------------------
147
+ * This section contains generic SWIG labels for method/variable
148
+ * declarations/attributes, and other compiler dependent labels.
149
+ * ----------------------------------------------------------------------------- */
150
+
151
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
152
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
153
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
154
+ # define SWIGTEMPLATEDISAMBIGUATOR template
155
+ # elif defined(__HP_aCC)
156
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
157
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
158
+ # define SWIGTEMPLATEDISAMBIGUATOR template
159
+ # else
160
+ # define SWIGTEMPLATEDISAMBIGUATOR
161
+ # endif
162
+ #endif
163
+
164
+ /* inline attribute */
165
+ #ifndef SWIGINLINE
166
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
167
+ # define SWIGINLINE inline
168
+ # else
169
+ # define SWIGINLINE
170
+ # endif
171
+ #endif
172
+
173
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
174
+ #ifndef SWIGUNUSED
175
+ # if defined(__GNUC__)
176
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
177
+ # define SWIGUNUSED __attribute__ ((__unused__))
178
+ # else
179
+ # define SWIGUNUSED
180
+ # endif
181
+ # elif defined(__ICC)
182
+ # define SWIGUNUSED __attribute__ ((__unused__))
183
+ # else
184
+ # define SWIGUNUSED
185
+ # endif
186
+ #endif
187
+
188
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
189
+ # if defined(_MSC_VER)
190
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
191
+ # endif
192
+ #endif
193
+
194
+ #ifndef SWIGUNUSEDPARM
195
+ # ifdef __cplusplus
196
+ # define SWIGUNUSEDPARM(p)
197
+ # else
198
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
199
+ # endif
200
+ #endif
201
+
202
+ /* internal SWIG method */
203
+ #ifndef SWIGINTERN
204
+ # define SWIGINTERN static SWIGUNUSED
205
+ #endif
206
+
207
+ /* internal inline SWIG method */
208
+ #ifndef SWIGINTERNINLINE
209
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
210
+ #endif
211
+
212
+ /* exporting methods */
213
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
214
+ # ifndef GCC_HASCLASSVISIBILITY
215
+ # define GCC_HASCLASSVISIBILITY
216
+ # endif
217
+ #endif
218
+
219
+ #ifndef SWIGEXPORT
220
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
221
+ # if defined(STATIC_LINKED)
222
+ # define SWIGEXPORT
223
+ # else
224
+ # define SWIGEXPORT __declspec(dllexport)
225
+ # endif
226
+ # else
227
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
228
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
229
+ # else
230
+ # define SWIGEXPORT
231
+ # endif
232
+ # endif
233
+ #endif
234
+
235
+ /* calling conventions for Windows */
236
+ #ifndef SWIGSTDCALL
237
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
238
+ # define SWIGSTDCALL __stdcall
239
+ # else
240
+ # define SWIGSTDCALL
241
+ # endif
242
+ #endif
243
+
244
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
245
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
246
+ # define _CRT_SECURE_NO_DEPRECATE
247
+ #endif
248
+
249
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
250
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
251
+ # define _SCL_SECURE_NO_DEPRECATE
252
+ #endif
253
+
254
+
255
+ /* -----------------------------------------------------------------------------
256
+ * swigrun.swg
257
+ *
258
+ * This file contains generic C API SWIG runtime support for pointer
259
+ * type checking.
260
+ * ----------------------------------------------------------------------------- */
261
+
262
+ /* This should only be incremented when either the layout of swig_type_info changes,
263
+ or for whatever reason, the runtime changes incompatibly */
264
+ #define SWIG_RUNTIME_VERSION "4"
265
+
266
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
267
+ #ifdef SWIG_TYPE_TABLE
268
+ # define SWIG_QUOTE_STRING(x) #x
269
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
270
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
271
+ #else
272
+ # define SWIG_TYPE_TABLE_NAME
273
+ #endif
274
+
275
+ /*
276
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
277
+ creating a static or dynamic library from the SWIG runtime code.
278
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
279
+
280
+ But only do this if strictly necessary, ie, if you have problems
281
+ with your compiler or suchlike.
282
+ */
283
+
284
+ #ifndef SWIGRUNTIME
285
+ # define SWIGRUNTIME SWIGINTERN
286
+ #endif
287
+
288
+ #ifndef SWIGRUNTIMEINLINE
289
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
290
+ #endif
291
+
292
+ /* Generic buffer size */
293
+ #ifndef SWIG_BUFFER_SIZE
294
+ # define SWIG_BUFFER_SIZE 1024
295
+ #endif
296
+
297
+ /* Flags for pointer conversions */
298
+ #define SWIG_POINTER_DISOWN 0x1
299
+ #define SWIG_CAST_NEW_MEMORY 0x2
300
+
301
+ /* Flags for new pointer objects */
302
+ #define SWIG_POINTER_OWN 0x1
303
+
304
+
305
+ /*
306
+ Flags/methods for returning states.
307
+
308
+ The SWIG conversion methods, as ConvertPtr, return an integer
309
+ that tells if the conversion was successful or not. And if not,
310
+ an error code can be returned (see swigerrors.swg for the codes).
311
+
312
+ Use the following macros/flags to set or process the returning
313
+ states.
314
+
315
+ In old versions of SWIG, code such as the following was usually written:
316
+
317
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
318
+ // success code
319
+ } else {
320
+ //fail code
321
+ }
322
+
323
+ Now you can be more explicit:
324
+
325
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
326
+ if (SWIG_IsOK(res)) {
327
+ // success code
328
+ } else {
329
+ // fail code
330
+ }
331
+
332
+ which is the same really, but now you can also do
333
+
334
+ Type *ptr;
335
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
336
+ if (SWIG_IsOK(res)) {
337
+ // success code
338
+ if (SWIG_IsNewObj(res) {
339
+ ...
340
+ delete *ptr;
341
+ } else {
342
+ ...
343
+ }
344
+ } else {
345
+ // fail code
346
+ }
347
+
348
+ I.e., now SWIG_ConvertPtr can return new objects and you can
349
+ identify the case and take care of the deallocation. Of course that
350
+ also requires SWIG_ConvertPtr to return new result values, such as
351
+
352
+ int SWIG_ConvertPtr(obj, ptr,...) {
353
+ if (<obj is ok>) {
354
+ if (<need new object>) {
355
+ *ptr = <ptr to new allocated object>;
356
+ return SWIG_NEWOBJ;
357
+ } else {
358
+ *ptr = <ptr to old object>;
359
+ return SWIG_OLDOBJ;
360
+ }
361
+ } else {
362
+ return SWIG_BADOBJ;
363
+ }
364
+ }
365
+
366
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
367
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
368
+ SWIG errors code.
369
+
370
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
371
+ allows to return the 'cast rank', for example, if you have this
372
+
373
+ int food(double)
374
+ int fooi(int);
375
+
376
+ and you call
377
+
378
+ food(1) // cast rank '1' (1 -> 1.0)
379
+ fooi(1) // cast rank '0'
380
+
381
+ just use the SWIG_AddCast()/SWIG_CheckState()
382
+ */
383
+
384
+ #define SWIG_OK (0)
385
+ #define SWIG_ERROR (-1)
386
+ #define SWIG_IsOK(r) (r >= 0)
387
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
388
+
389
+ /* The CastRankLimit says how many bits are used for the cast rank */
390
+ #define SWIG_CASTRANKLIMIT (1 << 8)
391
+ /* The NewMask denotes the object was created (using new/malloc) */
392
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
393
+ /* The TmpMask is for in/out typemaps that use temporal objects */
394
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
395
+ /* Simple returning values */
396
+ #define SWIG_BADOBJ (SWIG_ERROR)
397
+ #define SWIG_OLDOBJ (SWIG_OK)
398
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
399
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
400
+ /* Check, add and del mask methods */
401
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
402
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
403
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
404
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
405
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
406
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
407
+
408
+ /* Cast-Rank Mode */
409
+ #if defined(SWIG_CASTRANK_MODE)
410
+ # ifndef SWIG_TypeRank
411
+ # define SWIG_TypeRank unsigned long
412
+ # endif
413
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
414
+ # define SWIG_MAXCASTRANK (2)
415
+ # endif
416
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
417
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
418
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
419
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
420
+ }
421
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
422
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
423
+ }
424
+ #else /* no cast-rank mode */
425
+ # define SWIG_AddCast(r) (r)
426
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
427
+ #endif
428
+
429
+
430
+ #include <string.h>
431
+
432
+ #ifdef __cplusplus
433
+ extern "C" {
434
+ #endif
435
+
436
+ typedef void *(*swig_converter_func)(void *, int *);
437
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
438
+
439
+ /* Structure to store information on one type */
440
+ typedef struct swig_type_info {
441
+ const char *name; /* mangled name of this type */
442
+ const char *str; /* human readable name of this type */
443
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
444
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
445
+ void *clientdata; /* language specific type data */
446
+ int owndata; /* flag if the structure owns the clientdata */
447
+ } swig_type_info;
448
+
449
+ /* Structure to store a type and conversion function used for casting */
450
+ typedef struct swig_cast_info {
451
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
452
+ swig_converter_func converter; /* function to cast the void pointers */
453
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
454
+ struct swig_cast_info *prev; /* pointer to the previous cast */
455
+ } swig_cast_info;
456
+
457
+ /* Structure used to store module information
458
+ * Each module generates one structure like this, and the runtime collects
459
+ * all of these structures and stores them in a circularly linked list.*/
460
+ typedef struct swig_module_info {
461
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
462
+ size_t size; /* Number of types in this module */
463
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
464
+ swig_type_info **type_initial; /* Array of initially generated type structures */
465
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
466
+ void *clientdata; /* Language specific module data */
467
+ } swig_module_info;
468
+
469
+ /*
470
+ Compare two type names skipping the space characters, therefore
471
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
472
+
473
+ Return 0 when the two name types are equivalent, as in
474
+ strncmp, but skipping ' '.
475
+ */
476
+ SWIGRUNTIME int
477
+ SWIG_TypeNameComp(const char *f1, const char *l1,
478
+ const char *f2, const char *l2) {
479
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
480
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
481
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
482
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
483
+ }
484
+ return (int)((l1 - f1) - (l2 - f2));
485
+ }
486
+
487
+ /*
488
+ Check type equivalence in a name list like <name1>|<name2>|...
489
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
490
+ */
491
+ SWIGRUNTIME int
492
+ SWIG_TypeCmp(const char *nb, const char *tb) {
493
+ int equiv = 1;
494
+ const char* te = tb + strlen(tb);
495
+ const char* ne = nb;
496
+ while (equiv != 0 && *ne) {
497
+ for (nb = ne; *ne; ++ne) {
498
+ if (*ne == '|') break;
499
+ }
500
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
501
+ if (*ne) ++ne;
502
+ }
503
+ return equiv;
504
+ }
505
+
506
+ /*
507
+ Check type equivalence in a name list like <name1>|<name2>|...
508
+ Return 0 if not equal, 1 if equal
509
+ */
510
+ SWIGRUNTIME int
511
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
512
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
513
+ }
514
+
515
+ /*
516
+ Check the typename
517
+ */
518
+ SWIGRUNTIME swig_cast_info *
519
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
520
+ if (ty) {
521
+ swig_cast_info *iter = ty->cast;
522
+ while (iter) {
523
+ if (strcmp(iter->type->name, c) == 0) {
524
+ if (iter == ty->cast)
525
+ return iter;
526
+ /* Move iter to the top of the linked list */
527
+ iter->prev->next = iter->next;
528
+ if (iter->next)
529
+ iter->next->prev = iter->prev;
530
+ iter->next = ty->cast;
531
+ iter->prev = 0;
532
+ if (ty->cast) ty->cast->prev = iter;
533
+ ty->cast = iter;
534
+ return iter;
535
+ }
536
+ iter = iter->next;
537
+ }
538
+ }
539
+ return 0;
540
+ }
541
+
542
+ /*
543
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
544
+ */
545
+ SWIGRUNTIME swig_cast_info *
546
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
547
+ if (ty) {
548
+ swig_cast_info *iter = ty->cast;
549
+ while (iter) {
550
+ if (iter->type == from) {
551
+ if (iter == ty->cast)
552
+ return iter;
553
+ /* Move iter to the top of the linked list */
554
+ iter->prev->next = iter->next;
555
+ if (iter->next)
556
+ iter->next->prev = iter->prev;
557
+ iter->next = ty->cast;
558
+ iter->prev = 0;
559
+ if (ty->cast) ty->cast->prev = iter;
560
+ ty->cast = iter;
561
+ return iter;
562
+ }
563
+ iter = iter->next;
564
+ }
565
+ }
566
+ return 0;
567
+ }
568
+
569
+ /*
570
+ Cast a pointer up an inheritance hierarchy
571
+ */
572
+ SWIGRUNTIMEINLINE void *
573
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
574
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
575
+ }
576
+
577
+ /*
578
+ Dynamic pointer casting. Down an inheritance hierarchy
579
+ */
580
+ SWIGRUNTIME swig_type_info *
581
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
582
+ swig_type_info *lastty = ty;
583
+ if (!ty || !ty->dcast) return ty;
584
+ while (ty && (ty->dcast)) {
585
+ ty = (*ty->dcast)(ptr);
586
+ if (ty) lastty = ty;
587
+ }
588
+ return lastty;
589
+ }
590
+
591
+ /*
592
+ Return the name associated with this type
593
+ */
594
+ SWIGRUNTIMEINLINE const char *
595
+ SWIG_TypeName(const swig_type_info *ty) {
596
+ return ty->name;
597
+ }
598
+
599
+ /*
600
+ Return the pretty name associated with this type,
601
+ that is an unmangled type name in a form presentable to the user.
602
+ */
603
+ SWIGRUNTIME const char *
604
+ SWIG_TypePrettyName(const swig_type_info *type) {
605
+ /* The "str" field contains the equivalent pretty names of the
606
+ type, separated by vertical-bar characters. We choose
607
+ to print the last name, as it is often (?) the most
608
+ specific. */
609
+ if (!type) return NULL;
610
+ if (type->str != NULL) {
611
+ const char *last_name = type->str;
612
+ const char *s;
613
+ for (s = type->str; *s; s++)
614
+ if (*s == '|') last_name = s+1;
615
+ return last_name;
616
+ }
617
+ else
618
+ return type->name;
619
+ }
620
+
621
+ /*
622
+ Set the clientdata field for a type
623
+ */
624
+ SWIGRUNTIME void
625
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
626
+ swig_cast_info *cast = ti->cast;
627
+ /* if (ti->clientdata == clientdata) return; */
628
+ ti->clientdata = clientdata;
629
+
630
+ while (cast) {
631
+ if (!cast->converter) {
632
+ swig_type_info *tc = cast->type;
633
+ if (!tc->clientdata) {
634
+ SWIG_TypeClientData(tc, clientdata);
635
+ }
636
+ }
637
+ cast = cast->next;
638
+ }
639
+ }
640
+ SWIGRUNTIME void
641
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
642
+ SWIG_TypeClientData(ti, clientdata);
643
+ ti->owndata = 1;
644
+ }
645
+
646
+ /*
647
+ Search for a swig_type_info structure only by mangled name
648
+ Search is a O(log #types)
649
+
650
+ We start searching at module start, and finish searching when start == end.
651
+ Note: if start == end at the beginning of the function, we go all the way around
652
+ the circular list.
653
+ */
654
+ SWIGRUNTIME swig_type_info *
655
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
656
+ swig_module_info *end,
657
+ const char *name) {
658
+ swig_module_info *iter = start;
659
+ do {
660
+ if (iter->size) {
661
+ register size_t l = 0;
662
+ register size_t r = iter->size - 1;
663
+ do {
664
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
665
+ register size_t i = (l + r) >> 1;
666
+ const char *iname = iter->types[i]->name;
667
+ if (iname) {
668
+ register int compare = strcmp(name, iname);
669
+ if (compare == 0) {
670
+ return iter->types[i];
671
+ } else if (compare < 0) {
672
+ if (i) {
673
+ r = i - 1;
674
+ } else {
675
+ break;
676
+ }
677
+ } else if (compare > 0) {
678
+ l = i + 1;
679
+ }
680
+ } else {
681
+ break; /* should never happen */
682
+ }
683
+ } while (l <= r);
684
+ }
685
+ iter = iter->next;
686
+ } while (iter != end);
687
+ return 0;
688
+ }
689
+
690
+ /*
691
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
692
+ It first searches the mangled names of the types, which is a O(log #types)
693
+ If a type is not found it then searches the human readable names, which is O(#types).
694
+
695
+ We start searching at module start, and finish searching when start == end.
696
+ Note: if start == end at the beginning of the function, we go all the way around
697
+ the circular list.
698
+ */
699
+ SWIGRUNTIME swig_type_info *
700
+ SWIG_TypeQueryModule(swig_module_info *start,
701
+ swig_module_info *end,
702
+ const char *name) {
703
+ /* STEP 1: Search the name field using binary search */
704
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
705
+ if (ret) {
706
+ return ret;
707
+ } else {
708
+ /* STEP 2: If the type hasn't been found, do a complete search
709
+ of the str field (the human readable name) */
710
+ swig_module_info *iter = start;
711
+ do {
712
+ register size_t i = 0;
713
+ for (; i < iter->size; ++i) {
714
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
715
+ return iter->types[i];
716
+ }
717
+ iter = iter->next;
718
+ } while (iter != end);
719
+ }
720
+
721
+ /* neither found a match */
722
+ return 0;
723
+ }
724
+
725
+ /*
726
+ Pack binary data into a string
727
+ */
728
+ SWIGRUNTIME char *
729
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
730
+ static const char hex[17] = "0123456789abcdef";
731
+ register const unsigned char *u = (unsigned char *) ptr;
732
+ register const unsigned char *eu = u + sz;
733
+ for (; u != eu; ++u) {
734
+ register unsigned char uu = *u;
735
+ *(c++) = hex[(uu & 0xf0) >> 4];
736
+ *(c++) = hex[uu & 0xf];
737
+ }
738
+ return c;
739
+ }
740
+
741
+ /*
742
+ Unpack binary data from a string
743
+ */
744
+ SWIGRUNTIME const char *
745
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
746
+ register unsigned char *u = (unsigned char *) ptr;
747
+ register const unsigned char *eu = u + sz;
748
+ for (; u != eu; ++u) {
749
+ register char d = *(c++);
750
+ register unsigned char uu;
751
+ if ((d >= '0') && (d <= '9'))
752
+ uu = ((d - '0') << 4);
753
+ else if ((d >= 'a') && (d <= 'f'))
754
+ uu = ((d - ('a'-10)) << 4);
755
+ else
756
+ return (char *) 0;
757
+ d = *(c++);
758
+ if ((d >= '0') && (d <= '9'))
759
+ uu |= (d - '0');
760
+ else if ((d >= 'a') && (d <= 'f'))
761
+ uu |= (d - ('a'-10));
762
+ else
763
+ return (char *) 0;
764
+ *u = uu;
765
+ }
766
+ return c;
767
+ }
768
+
769
+ /*
770
+ Pack 'void *' into a string buffer.
771
+ */
772
+ SWIGRUNTIME char *
773
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
774
+ char *r = buff;
775
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
776
+ *(r++) = '_';
777
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
778
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
779
+ strcpy(r,name);
780
+ return buff;
781
+ }
782
+
783
+ SWIGRUNTIME const char *
784
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
785
+ if (*c != '_') {
786
+ if (strcmp(c,"NULL") == 0) {
787
+ *ptr = (void *) 0;
788
+ return name;
789
+ } else {
790
+ return 0;
791
+ }
792
+ }
793
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
794
+ }
795
+
796
+ SWIGRUNTIME char *
797
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
798
+ char *r = buff;
799
+ size_t lname = (name ? strlen(name) : 0);
800
+ if ((2*sz + 2 + lname) > bsz) return 0;
801
+ *(r++) = '_';
802
+ r = SWIG_PackData(r,ptr,sz);
803
+ if (lname) {
804
+ strncpy(r,name,lname+1);
805
+ } else {
806
+ *r = 0;
807
+ }
808
+ return buff;
809
+ }
810
+
811
+ SWIGRUNTIME const char *
812
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
813
+ if (*c != '_') {
814
+ if (strcmp(c,"NULL") == 0) {
815
+ memset(ptr,0,sz);
816
+ return name;
817
+ } else {
818
+ return 0;
819
+ }
820
+ }
821
+ return SWIG_UnpackData(++c,ptr,sz);
822
+ }
823
+
824
+ #ifdef __cplusplus
825
+ }
826
+ #endif
827
+
828
+ /* Errors in SWIG */
829
+ #define SWIG_UnknownError -1
830
+ #define SWIG_IOError -2
831
+ #define SWIG_RuntimeError -3
832
+ #define SWIG_IndexError -4
833
+ #define SWIG_TypeError -5
834
+ #define SWIG_DivisionByZero -6
835
+ #define SWIG_OverflowError -7
836
+ #define SWIG_SyntaxError -8
837
+ #define SWIG_ValueError -9
838
+ #define SWIG_SystemError -10
839
+ #define SWIG_AttributeError -11
840
+ #define SWIG_MemoryError -12
841
+ #define SWIG_NullReferenceError -13
842
+
843
+
844
+
845
+ #include <ruby.h>
846
+
847
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
848
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
849
+ * issue for now by disabling this.
850
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
851
+ */
852
+ #ifdef rb_intern
853
+ # undef rb_intern
854
+ #endif
855
+
856
+ /* Remove global macros defined in Ruby's win32.h */
857
+ #ifdef write
858
+ # undef write
859
+ #endif
860
+ #ifdef read
861
+ # undef read
862
+ #endif
863
+ #ifdef bind
864
+ # undef bind
865
+ #endif
866
+ #ifdef close
867
+ # undef close
868
+ #endif
869
+ #ifdef connect
870
+ # undef connect
871
+ #endif
872
+
873
+
874
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
875
+ #ifndef NUM2LL
876
+ #define NUM2LL(x) NUM2LONG((x))
877
+ #endif
878
+ #ifndef LL2NUM
879
+ #define LL2NUM(x) INT2NUM((long) (x))
880
+ #endif
881
+ #ifndef ULL2NUM
882
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
883
+ #endif
884
+
885
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
886
+ #ifndef NUM2ULL
887
+ #ifdef HAVE_LONG_LONG
888
+ #define NUM2ULL(x) rb_num2ull((x))
889
+ #else
890
+ #define NUM2ULL(x) NUM2ULONG(x)
891
+ #endif
892
+ #endif
893
+
894
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
895
+ /* Define these for older versions so we can just write code the new way */
896
+ #ifndef RSTRING_LEN
897
+ # define RSTRING_LEN(x) RSTRING(x)->len
898
+ #endif
899
+ #ifndef RSTRING_PTR
900
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
901
+ #endif
902
+ #ifndef RSTRING_END
903
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
904
+ #endif
905
+ #ifndef RARRAY_LEN
906
+ # define RARRAY_LEN(x) RARRAY(x)->len
907
+ #endif
908
+ #ifndef RARRAY_PTR
909
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
910
+ #endif
911
+ #ifndef RFLOAT_VALUE
912
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
913
+ #endif
914
+ #ifndef DOUBLE2NUM
915
+ # define DOUBLE2NUM(x) rb_float_new(x)
916
+ #endif
917
+ #ifndef RHASH_TBL
918
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
919
+ #endif
920
+ #ifndef RHASH_ITER_LEV
921
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
922
+ #endif
923
+ #ifndef RHASH_IFNONE
924
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
925
+ #endif
926
+ #ifndef RHASH_SIZE
927
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
928
+ #endif
929
+ #ifndef RHASH_EMPTY_P
930
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
931
+ #endif
932
+ #ifndef RSTRUCT_LEN
933
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
934
+ #endif
935
+ #ifndef RSTRUCT_PTR
936
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
937
+ #endif
938
+
939
+
940
+
941
+ /*
942
+ * Need to be very careful about how these macros are defined, especially
943
+ * when compiling C++ code or C code with an ANSI C compiler.
944
+ *
945
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
946
+ * a Ruby method so that it can be passed as an argument to API functions
947
+ * like rb_define_method() and rb_define_singleton_method().
948
+ *
949
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
950
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
951
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
952
+ * and Data_Make_Struct().
953
+ */
954
+
955
+ #ifdef __cplusplus
956
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
957
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
958
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
959
+ # define VOIDFUNC(f) ((void (*)()) f)
960
+ # else
961
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
962
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
963
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
964
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
965
+ # else /* These definitions should work for Ruby 1.7+ */
966
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
967
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
968
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
969
+ # endif
970
+ # endif
971
+ #else
972
+ # define VALUEFUNC(f) (f)
973
+ # define VOIDFUNC(f) (f)
974
+ #endif
975
+
976
+ /* Don't use for expressions have side effect */
977
+ #ifndef RB_STRING_VALUE
978
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
979
+ #endif
980
+ #ifndef StringValue
981
+ #define StringValue(s) RB_STRING_VALUE(s)
982
+ #endif
983
+ #ifndef StringValuePtr
984
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
985
+ #endif
986
+ #ifndef StringValueLen
987
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
988
+ #endif
989
+ #ifndef SafeStringValue
990
+ #define SafeStringValue(v) do {\
991
+ StringValue(v);\
992
+ rb_check_safe_str(v);\
993
+ } while (0)
994
+ #endif
995
+
996
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
997
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
998
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
999
+ #endif
1000
+
1001
+ static VALUE _mSWIG = Qnil;
1002
+
1003
+ /* -----------------------------------------------------------------------------
1004
+ * error manipulation
1005
+ * ----------------------------------------------------------------------------- */
1006
+
1007
+
1008
+ /* Define some additional error types */
1009
+ #define SWIG_ObjectPreviouslyDeletedError -100
1010
+
1011
+
1012
+ /* Define custom exceptions for errors that do not map to existing Ruby
1013
+ exceptions. Note this only works for C++ since a global cannot be
1014
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
1015
+
1016
+ SWIGINTERN VALUE
1017
+ getNullReferenceError(void) {
1018
+ static int init = 0;
1019
+ static VALUE rb_eNullReferenceError ;
1020
+ if (!init) {
1021
+ init = 1;
1022
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1023
+ }
1024
+ return rb_eNullReferenceError;
1025
+ }
1026
+
1027
+ SWIGINTERN VALUE
1028
+ getObjectPreviouslyDeletedError(void) {
1029
+ static int init = 0;
1030
+ static VALUE rb_eObjectPreviouslyDeleted ;
1031
+ if (!init) {
1032
+ init = 1;
1033
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1034
+ }
1035
+ return rb_eObjectPreviouslyDeleted;
1036
+ }
1037
+
1038
+
1039
+ SWIGINTERN VALUE
1040
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1041
+ VALUE type;
1042
+ switch (SWIG_code) {
1043
+ case SWIG_MemoryError:
1044
+ type = rb_eNoMemError;
1045
+ break;
1046
+ case SWIG_IOError:
1047
+ type = rb_eIOError;
1048
+ break;
1049
+ case SWIG_RuntimeError:
1050
+ type = rb_eRuntimeError;
1051
+ break;
1052
+ case SWIG_IndexError:
1053
+ type = rb_eIndexError;
1054
+ break;
1055
+ case SWIG_TypeError:
1056
+ type = rb_eTypeError;
1057
+ break;
1058
+ case SWIG_DivisionByZero:
1059
+ type = rb_eZeroDivError;
1060
+ break;
1061
+ case SWIG_OverflowError:
1062
+ type = rb_eRangeError;
1063
+ break;
1064
+ case SWIG_SyntaxError:
1065
+ type = rb_eSyntaxError;
1066
+ break;
1067
+ case SWIG_ValueError:
1068
+ type = rb_eArgError;
1069
+ break;
1070
+ case SWIG_SystemError:
1071
+ type = rb_eFatal;
1072
+ break;
1073
+ case SWIG_AttributeError:
1074
+ type = rb_eRuntimeError;
1075
+ break;
1076
+ case SWIG_NullReferenceError:
1077
+ type = getNullReferenceError();
1078
+ break;
1079
+ case SWIG_ObjectPreviouslyDeletedError:
1080
+ type = getObjectPreviouslyDeletedError();
1081
+ break;
1082
+ case SWIG_UnknownError:
1083
+ type = rb_eRuntimeError;
1084
+ break;
1085
+ default:
1086
+ type = rb_eRuntimeError;
1087
+ }
1088
+ return type;
1089
+ }
1090
+
1091
+
1092
+ /* This function is called when a user inputs a wrong argument to
1093
+ a method.
1094
+ */
1095
+ SWIGINTERN
1096
+ const char* Ruby_Format_TypeError( const char* msg,
1097
+ const char* type,
1098
+ const char* name,
1099
+ const int argn,
1100
+ VALUE input )
1101
+ {
1102
+ char buf[128];
1103
+ VALUE str;
1104
+ VALUE asStr;
1105
+ if ( msg && *msg )
1106
+ {
1107
+ str = rb_str_new2(msg);
1108
+ }
1109
+ else
1110
+ {
1111
+ str = rb_str_new(NULL, 0);
1112
+ }
1113
+
1114
+ str = rb_str_cat2( str, "Expected argument " );
1115
+ sprintf( buf, "%d of type ", argn-1 );
1116
+ str = rb_str_cat2( str, buf );
1117
+ str = rb_str_cat2( str, type );
1118
+ str = rb_str_cat2( str, ", but got " );
1119
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1120
+ str = rb_str_cat2( str, " " );
1121
+ asStr = rb_inspect(input);
1122
+ if ( RSTRING_LEN(asStr) > 30 )
1123
+ {
1124
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1125
+ str = rb_str_cat2( str, "..." );
1126
+ }
1127
+ else
1128
+ {
1129
+ str = rb_str_append( str, asStr );
1130
+ }
1131
+
1132
+ if ( name )
1133
+ {
1134
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1135
+ str = rb_str_cat2( str, name );
1136
+ str = rb_str_cat2( str, "'" );
1137
+ }
1138
+
1139
+ return StringValuePtr( str );
1140
+ }
1141
+
1142
+ /* This function is called when an overloaded method fails */
1143
+ SWIGINTERN
1144
+ void Ruby_Format_OverloadedError(
1145
+ const int argc,
1146
+ const int maxargs,
1147
+ const char* method,
1148
+ const char* prototypes
1149
+ )
1150
+ {
1151
+ const char* msg = "Wrong # of arguments";
1152
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1153
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1154
+ "Possible C/C++ prototypes are:\n%s",
1155
+ msg, method, prototypes);
1156
+ }
1157
+
1158
+ /* -----------------------------------------------------------------------------
1159
+ * rubytracking.swg
1160
+ *
1161
+ * This file contains support for tracking mappings from
1162
+ * Ruby objects to C++ objects. This functionality is needed
1163
+ * to implement mark functions for Ruby's mark and sweep
1164
+ * garbage collector.
1165
+ * ----------------------------------------------------------------------------- */
1166
+
1167
+ #ifdef __cplusplus
1168
+ extern "C" {
1169
+ #endif
1170
+
1171
+ /* Ruby 1.8 actually assumes the first case. */
1172
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1173
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1174
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1175
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1176
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1177
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1178
+ #else
1179
+ # error sizeof(void*) is not the same as long or long long
1180
+ #endif
1181
+
1182
+
1183
+ /* Global Ruby hash table to store Trackings from C/C++
1184
+ structs to Ruby Objects.
1185
+ */
1186
+ static VALUE swig_ruby_trackings = Qnil;
1187
+
1188
+ /* Global variable that stores a reference to the ruby
1189
+ hash table delete function. */
1190
+ static ID swig_ruby_hash_delete;
1191
+
1192
+ /* Setup a Ruby hash table to store Trackings */
1193
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1194
+ /* Create a ruby hash table to store Trackings from C++
1195
+ objects to Ruby objects. */
1196
+
1197
+ /* Try to see if some other .so has already created a
1198
+ tracking hash table, which we keep hidden in an instance var
1199
+ in the SWIG module.
1200
+ This is done to allow multiple DSOs to share the same
1201
+ tracking table.
1202
+ */
1203
+ ID trackings_id = rb_intern( "@__trackings__" );
1204
+ VALUE verbose = rb_gv_get("VERBOSE");
1205
+ rb_gv_set("VERBOSE", Qfalse);
1206
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1207
+ rb_gv_set("VERBOSE", verbose);
1208
+
1209
+ /* No, it hasn't. Create one ourselves */
1210
+ if ( swig_ruby_trackings == Qnil )
1211
+ {
1212
+ swig_ruby_trackings = rb_hash_new();
1213
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1214
+ }
1215
+
1216
+ /* Now store a reference to the hash table delete function
1217
+ so that we only have to look it up once.*/
1218
+ swig_ruby_hash_delete = rb_intern("delete");
1219
+ }
1220
+
1221
+ /* Get a Ruby number to reference a pointer */
1222
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1223
+ /* We cast the pointer to an unsigned long
1224
+ and then store a reference to it using
1225
+ a Ruby number object. */
1226
+
1227
+ /* Convert the pointer to a Ruby number */
1228
+ return SWIG2NUM(ptr);
1229
+ }
1230
+
1231
+ /* Get a Ruby number to reference an object */
1232
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1233
+ /* We cast the object to an unsigned long
1234
+ and then store a reference to it using
1235
+ a Ruby number object. */
1236
+
1237
+ /* Convert the Object to a Ruby number */
1238
+ return SWIG2NUM(object);
1239
+ }
1240
+
1241
+ /* Get a Ruby object from a previously stored reference */
1242
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1243
+ /* The provided Ruby number object is a reference
1244
+ to the Ruby object we want.*/
1245
+
1246
+ /* Convert the Ruby number to a Ruby object */
1247
+ return NUM2SWIG(reference);
1248
+ }
1249
+
1250
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1251
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1252
+ /* In a Ruby hash table we store the pointer and
1253
+ the associated Ruby object. The trick here is
1254
+ that we cannot store the Ruby object directly - if
1255
+ we do then it cannot be garbage collected. So
1256
+ instead we typecast it as a unsigned long and
1257
+ convert it to a Ruby number object.*/
1258
+
1259
+ /* Get a reference to the pointer as a Ruby number */
1260
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1261
+
1262
+ /* Get a reference to the Ruby object as a Ruby number */
1263
+ VALUE value = SWIG_RubyObjectToReference(object);
1264
+
1265
+ /* Store the mapping to the global hash table. */
1266
+ rb_hash_aset(swig_ruby_trackings, key, value);
1267
+ }
1268
+
1269
+ /* Get the Ruby object that owns the specified C/C++ struct */
1270
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1271
+ /* Get a reference to the pointer as a Ruby number */
1272
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1273
+
1274
+ /* Now lookup the value stored in the global hash table */
1275
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1276
+
1277
+ if (value == Qnil) {
1278
+ /* No object exists - return nil. */
1279
+ return Qnil;
1280
+ }
1281
+ else {
1282
+ /* Convert this value to Ruby object */
1283
+ return SWIG_RubyReferenceToObject(value);
1284
+ }
1285
+ }
1286
+
1287
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1288
+ is very important to remove objects once they are destroyed
1289
+ since the same memory address may be reused later to create
1290
+ a new object. */
1291
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1292
+ /* Get a reference to the pointer as a Ruby number */
1293
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1294
+
1295
+ /* Delete the object from the hash table by calling Ruby's
1296
+ do this we need to call the Hash.delete method.*/
1297
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1298
+ }
1299
+
1300
+ /* This is a helper method that unlinks a Ruby object from its
1301
+ underlying C++ object. This is needed if the lifetime of the
1302
+ Ruby object is longer than the C++ object */
1303
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1304
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1305
+
1306
+ if (object != Qnil) {
1307
+ DATA_PTR(object) = 0;
1308
+ }
1309
+ }
1310
+
1311
+
1312
+ #ifdef __cplusplus
1313
+ }
1314
+ #endif
1315
+
1316
+ /* -----------------------------------------------------------------------------
1317
+ * Ruby API portion that goes into the runtime
1318
+ * ----------------------------------------------------------------------------- */
1319
+
1320
+ #ifdef __cplusplus
1321
+ extern "C" {
1322
+ #endif
1323
+
1324
+ SWIGINTERN VALUE
1325
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1326
+ if (NIL_P(target)) {
1327
+ target = o;
1328
+ } else {
1329
+ if (TYPE(target) != T_ARRAY) {
1330
+ VALUE o2 = target;
1331
+ target = rb_ary_new();
1332
+ rb_ary_push(target, o2);
1333
+ }
1334
+ rb_ary_push(target, o);
1335
+ }
1336
+ return target;
1337
+ }
1338
+
1339
+ /* For ruby1.8.4 and earlier. */
1340
+ #ifndef RUBY_INIT_STACK
1341
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1342
+ # define RUBY_INIT_STACK \
1343
+ VALUE variable_in_this_stack_frame; \
1344
+ Init_stack(&variable_in_this_stack_frame);
1345
+ #endif
1346
+
1347
+
1348
+ #ifdef __cplusplus
1349
+ }
1350
+ #endif
1351
+
1352
+
1353
+ /* -----------------------------------------------------------------------------
1354
+ * rubyrun.swg
1355
+ *
1356
+ * This file contains the runtime support for Ruby modules
1357
+ * and includes code for managing global variables and pointer
1358
+ * type checking.
1359
+ * ----------------------------------------------------------------------------- */
1360
+
1361
+ /* For backward compatibility only */
1362
+ #define SWIG_POINTER_EXCEPTION 0
1363
+
1364
+ /* for raw pointers */
1365
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1366
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1367
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1368
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1369
+ #define swig_owntype ruby_owntype
1370
+
1371
+ /* for raw packed data */
1372
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1373
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1374
+
1375
+ /* for class or struct pointers */
1376
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1377
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1378
+
1379
+ /* for C or C++ function pointers */
1380
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1381
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1382
+
1383
+ /* for C++ member pointers, ie, member methods */
1384
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1385
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1386
+
1387
+
1388
+ /* Runtime API */
1389
+
1390
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata)
1391
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1392
+
1393
+
1394
+ /* Error manipulation */
1395
+
1396
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1397
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1398
+ #define SWIG_fail goto fail
1399
+
1400
+
1401
+ /* Ruby-specific SWIG API */
1402
+
1403
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1404
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1405
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1406
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1407
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1408
+
1409
+ #include "assert.h"
1410
+
1411
+ /* -----------------------------------------------------------------------------
1412
+ * pointers/data manipulation
1413
+ * ----------------------------------------------------------------------------- */
1414
+
1415
+ #ifdef __cplusplus
1416
+ extern "C" {
1417
+ #endif
1418
+
1419
+ typedef struct {
1420
+ VALUE klass;
1421
+ VALUE mImpl;
1422
+ void (*mark)(void *);
1423
+ void (*destroy)(void *);
1424
+ int trackObjects;
1425
+ } swig_class;
1426
+
1427
+
1428
+ /* Global pointer used to keep some internal SWIG stuff */
1429
+ static VALUE _cSWIG_Pointer = Qnil;
1430
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1431
+
1432
+ /* Global IDs used to keep some internal SWIG stuff */
1433
+ static ID swig_arity_id = 0;
1434
+ static ID swig_call_id = 0;
1435
+
1436
+ /*
1437
+ If your swig extension is to be run within an embedded ruby and has
1438
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1439
+ This will reset ruby's stack frame on each entry point from the main
1440
+ program the first time a virtual director function is invoked (in a
1441
+ non-recursive way).
1442
+ If this is not done, you run the risk of Ruby trashing the stack.
1443
+ */
1444
+
1445
+ #ifdef RUBY_EMBEDDED
1446
+
1447
+ # define SWIG_INIT_STACK \
1448
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1449
+ ++swig_virtual_calls;
1450
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1451
+ # define Ruby_DirectorTypeMismatchException(x) \
1452
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1453
+
1454
+ static unsigned int swig_virtual_calls = 0;
1455
+
1456
+ #else /* normal non-embedded extension */
1457
+
1458
+ # define SWIG_INIT_STACK
1459
+ # define SWIG_RELEASE_STACK
1460
+ # define Ruby_DirectorTypeMismatchException(x) \
1461
+ throw Swig::DirectorTypeMismatchException( x );
1462
+
1463
+ #endif /* RUBY_EMBEDDED */
1464
+
1465
+
1466
+ SWIGRUNTIME VALUE
1467
+ getExceptionClass(void) {
1468
+ static int init = 0;
1469
+ static VALUE rubyExceptionClass ;
1470
+ if (!init) {
1471
+ init = 1;
1472
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1473
+ }
1474
+ return rubyExceptionClass;
1475
+ }
1476
+
1477
+ /* This code checks to see if the Ruby object being raised as part
1478
+ of an exception inherits from the Ruby class Exception. If so,
1479
+ the object is simply returned. If not, then a new Ruby exception
1480
+ object is created and that will be returned to Ruby.*/
1481
+ SWIGRUNTIME VALUE
1482
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1483
+ VALUE exceptionClass = getExceptionClass();
1484
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1485
+ return obj;
1486
+ } else {
1487
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1488
+ }
1489
+ }
1490
+
1491
+ /* Initialize Ruby runtime support */
1492
+ SWIGRUNTIME void
1493
+ SWIG_Ruby_InitRuntime(void)
1494
+ {
1495
+ if (_mSWIG == Qnil) {
1496
+ _mSWIG = rb_define_module("SWIG");
1497
+ swig_call_id = rb_intern("call");
1498
+ swig_arity_id = rb_intern("arity");
1499
+ }
1500
+ }
1501
+
1502
+ /* Define Ruby class for C type */
1503
+ SWIGRUNTIME void
1504
+ SWIG_Ruby_define_class(swig_type_info *type)
1505
+ {
1506
+ VALUE klass;
1507
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1508
+ sprintf(klass_name, "TYPE%s", type->name);
1509
+ if (NIL_P(_cSWIG_Pointer)) {
1510
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1511
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1512
+ }
1513
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1514
+ free((void *) klass_name);
1515
+ }
1516
+
1517
+ /* Create a new pointer object */
1518
+ SWIGRUNTIME VALUE
1519
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1520
+ {
1521
+ int own = flags & SWIG_POINTER_OWN;
1522
+ int track;
1523
+ char *klass_name;
1524
+ swig_class *sklass;
1525
+ VALUE klass;
1526
+ VALUE obj;
1527
+
1528
+ if (!ptr)
1529
+ return Qnil;
1530
+
1531
+ if (type->clientdata) {
1532
+ sklass = (swig_class *) type->clientdata;
1533
+
1534
+ /* Are we tracking this class and have we already returned this Ruby object? */
1535
+ track = sklass->trackObjects;
1536
+ if (track) {
1537
+ obj = SWIG_RubyInstanceFor(ptr);
1538
+
1539
+ /* Check the object's type and make sure it has the correct type.
1540
+ It might not in cases where methods do things like
1541
+ downcast methods. */
1542
+ if (obj != Qnil) {
1543
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1544
+ const char* type_name = RSTRING_PTR(value);
1545
+
1546
+ if (strcmp(type->name, type_name) == 0) {
1547
+ return obj;
1548
+ }
1549
+ }
1550
+ }
1551
+
1552
+ /* Create a new Ruby object */
1553
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1554
+ ( own ? VOIDFUNC(sklass->destroy) :
1555
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1556
+ ), ptr);
1557
+
1558
+ /* If tracking is on for this class then track this object. */
1559
+ if (track) {
1560
+ SWIG_RubyAddTracking(ptr, obj);
1561
+ }
1562
+ } else {
1563
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1564
+ sprintf(klass_name, "TYPE%s", type->name);
1565
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1566
+ free((void *) klass_name);
1567
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1568
+ }
1569
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1570
+
1571
+ return obj;
1572
+ }
1573
+
1574
+ /* Create a new class instance (always owned) */
1575
+ SWIGRUNTIME VALUE
1576
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1577
+ {
1578
+ VALUE obj;
1579
+ swig_class *sklass = (swig_class *) type->clientdata;
1580
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1581
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1582
+ return obj;
1583
+ }
1584
+
1585
+ /* Get type mangle from class name */
1586
+ SWIGRUNTIMEINLINE char *
1587
+ SWIG_Ruby_MangleStr(VALUE obj)
1588
+ {
1589
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1590
+ return StringValuePtr(stype);
1591
+ }
1592
+
1593
+ /* Acquire a pointer value */
1594
+ typedef void (*ruby_owntype)(void*);
1595
+
1596
+ SWIGRUNTIME ruby_owntype
1597
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1598
+ if (obj) {
1599
+ ruby_owntype oldown = RDATA(obj)->dfree;
1600
+ RDATA(obj)->dfree = own;
1601
+ return oldown;
1602
+ } else {
1603
+ return 0;
1604
+ }
1605
+ }
1606
+
1607
+ /* Convert a pointer value */
1608
+ SWIGRUNTIME int
1609
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1610
+ {
1611
+ char *c;
1612
+ swig_cast_info *tc;
1613
+ void *vptr = 0;
1614
+
1615
+ /* Grab the pointer */
1616
+ if (NIL_P(obj)) {
1617
+ *ptr = 0;
1618
+ return SWIG_OK;
1619
+ } else {
1620
+ if (TYPE(obj) != T_DATA) {
1621
+ return SWIG_ERROR;
1622
+ }
1623
+ Data_Get_Struct(obj, void, vptr);
1624
+ }
1625
+
1626
+ if (own) *own = RDATA(obj)->dfree;
1627
+
1628
+ /* Check to see if the input object is giving up ownership
1629
+ of the underlying C struct or C++ object. If so then we
1630
+ need to reset the destructor since the Ruby object no
1631
+ longer owns the underlying C++ object.*/
1632
+ if (flags & SWIG_POINTER_DISOWN) {
1633
+ /* Is tracking on for this class? */
1634
+ int track = 0;
1635
+ if (ty && ty->clientdata) {
1636
+ swig_class *sklass = (swig_class *) ty->clientdata;
1637
+ track = sklass->trackObjects;
1638
+ }
1639
+
1640
+ if (track) {
1641
+ /* We are tracking objects for this class. Thus we change the destructor
1642
+ * to SWIG_RubyRemoveTracking. This allows us to
1643
+ * remove the mapping from the C++ to Ruby object
1644
+ * when the Ruby object is garbage collected. If we don't
1645
+ * do this, then it is possible we will return a reference
1646
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1647
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1648
+ } else {
1649
+ RDATA(obj)->dfree = 0;
1650
+ }
1651
+ }
1652
+
1653
+ /* Do type-checking if type info was provided */
1654
+ if (ty) {
1655
+ if (ty->clientdata) {
1656
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1657
+ if (vptr == 0) {
1658
+ /* The object has already been deleted */
1659
+ return SWIG_ObjectPreviouslyDeletedError;
1660
+ }
1661
+ *ptr = vptr;
1662
+ return SWIG_OK;
1663
+ }
1664
+ }
1665
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1666
+ return SWIG_ERROR;
1667
+ }
1668
+ tc = SWIG_TypeCheck(c, ty);
1669
+ if (!tc) {
1670
+ return SWIG_ERROR;
1671
+ } else {
1672
+ int newmemory = 0;
1673
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1674
+ assert(!newmemory); /* newmemory handling not yet implemented */
1675
+ }
1676
+ } else {
1677
+ *ptr = vptr;
1678
+ }
1679
+
1680
+ return SWIG_OK;
1681
+ }
1682
+
1683
+ /* Check convert */
1684
+ SWIGRUNTIMEINLINE int
1685
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1686
+ {
1687
+ char *c = SWIG_MangleStr(obj);
1688
+ if (!c) return 0;
1689
+ return SWIG_TypeCheck(c,ty) != 0;
1690
+ }
1691
+
1692
+ SWIGRUNTIME VALUE
1693
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1694
+ char result[1024];
1695
+ char *r = result;
1696
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1697
+ *(r++) = '_';
1698
+ r = SWIG_PackData(r, ptr, sz);
1699
+ strcpy(r, type->name);
1700
+ return rb_str_new2(result);
1701
+ }
1702
+
1703
+ /* Convert a packed value value */
1704
+ SWIGRUNTIME int
1705
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1706
+ swig_cast_info *tc;
1707
+ const char *c;
1708
+
1709
+ if (TYPE(obj) != T_STRING) goto type_error;
1710
+ c = StringValuePtr(obj);
1711
+ /* Pointer values must start with leading underscore */
1712
+ if (*c != '_') goto type_error;
1713
+ c++;
1714
+ c = SWIG_UnpackData(c, ptr, sz);
1715
+ if (ty) {
1716
+ tc = SWIG_TypeCheck(c, ty);
1717
+ if (!tc) goto type_error;
1718
+ }
1719
+ return SWIG_OK;
1720
+
1721
+ type_error:
1722
+ return SWIG_ERROR;
1723
+ }
1724
+
1725
+ SWIGRUNTIME swig_module_info *
1726
+ SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata))
1727
+ {
1728
+ VALUE pointer;
1729
+ swig_module_info *ret = 0;
1730
+ VALUE verbose = rb_gv_get("VERBOSE");
1731
+
1732
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1733
+ rb_gv_set("VERBOSE", Qfalse);
1734
+
1735
+ /* first check if pointer already created */
1736
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1737
+ if (pointer != Qnil) {
1738
+ Data_Get_Struct(pointer, swig_module_info, ret);
1739
+ }
1740
+
1741
+ /* reinstate warnings */
1742
+ rb_gv_set("VERBOSE", verbose);
1743
+ return ret;
1744
+ }
1745
+
1746
+ SWIGRUNTIME void
1747
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1748
+ {
1749
+ /* register a new class */
1750
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1751
+ /* create and store the structure pointer to a global variable */
1752
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1753
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1754
+ }
1755
+
1756
+ /* This function can be used to check whether a proc or method or similarly
1757
+ callable function has been passed. Usually used in a %typecheck, like:
1758
+
1759
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1760
+ $result = SWIG_Ruby_isCallable( $input );
1761
+ }
1762
+ */
1763
+ SWIGINTERN
1764
+ int SWIG_Ruby_isCallable( VALUE proc )
1765
+ {
1766
+ if ( rb_respond_to( proc, swig_call_id ) )
1767
+ return 1;
1768
+ return 0;
1769
+ }
1770
+
1771
+ /* This function can be used to check the arity (number of arguments)
1772
+ a proc or method can take. Usually used in a %typecheck.
1773
+ Valid arities will be that equal to minimal or those < 0
1774
+ which indicate a variable number of parameters at the end.
1775
+ */
1776
+ SWIGINTERN
1777
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1778
+ {
1779
+ if ( rb_respond_to( proc, swig_arity_id ) )
1780
+ {
1781
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1782
+ int arity = NUM2INT(num);
1783
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1784
+ if ( arity == minimal ) return 1;
1785
+ return 1;
1786
+ }
1787
+ return 0;
1788
+ }
1789
+
1790
+
1791
+ #ifdef __cplusplus
1792
+ }
1793
+ #endif
1794
+
1795
+
1796
+
1797
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1798
+
1799
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1800
+
1801
+
1802
+
1803
+ #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0)
1804
+
1805
+
1806
+ /* -------- TYPES TABLE (BEGIN) -------- */
1807
+
1808
+ #define SWIGTYPE_p_CaboCha__Parser swig_types[0]
1809
+ #define SWIGTYPE_p_CaboCha__Tree swig_types[1]
1810
+ #define SWIGTYPE_p_cabocha_chunk_t swig_types[2]
1811
+ #define SWIGTYPE_p_cabocha_t swig_types[3]
1812
+ #define SWIGTYPE_p_cabocha_token_t swig_types[4]
1813
+ #define SWIGTYPE_p_cabocha_tree_t swig_types[5]
1814
+ #define SWIGTYPE_p_char swig_types[6]
1815
+ #define SWIGTYPE_p_mecab_node_t swig_types[7]
1816
+ static swig_type_info *swig_types[9];
1817
+ static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
1818
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1819
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1820
+
1821
+ /* -------- TYPES TABLE (END) -------- */
1822
+
1823
+ #define SWIG_init Init_CaboCha
1824
+ #define SWIG_name "CaboCha"
1825
+
1826
+ static VALUE mCaboCha;
1827
+
1828
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1829
+ #define SWIG_RUBY_THREAD_END_BLOCK
1830
+
1831
+
1832
+ #define SWIGVERSION 0x020011
1833
+ #define SWIG_VERSION SWIGVERSION
1834
+
1835
+
1836
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1837
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1838
+
1839
+
1840
+ #include <stdexcept>
1841
+
1842
+
1843
+ #include "cabocha.h"
1844
+
1845
+
1846
+ void delete_CaboCha_Parser(CaboCha::Parser *t) {
1847
+ delete t;
1848
+ t = 0;
1849
+ }
1850
+
1851
+ CaboCha::Parser* new_CaboCha_Parser(const char *arg) {
1852
+ CaboCha::Parser *parser = CaboCha::createParser(arg);
1853
+ if (!parser) throw CaboCha::getParserError();
1854
+ return parser;
1855
+ }
1856
+
1857
+ CaboCha::Parser* new_CaboCha_Parser() {
1858
+ CaboCha::Parser *parser = CaboCha::createParser("");
1859
+ if (!parser) throw CaboCha::getParserError();
1860
+ return parser;
1861
+ }
1862
+
1863
+
1864
+
1865
+ #include <limits.h>
1866
+ #if !defined(SWIG_NO_LLONG_MAX)
1867
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1868
+ # define LLONG_MAX __LONG_LONG_MAX__
1869
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1870
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1871
+ # endif
1872
+ #endif
1873
+
1874
+
1875
+ #define SWIG_From_long LONG2NUM
1876
+
1877
+
1878
+ SWIGINTERNINLINE VALUE
1879
+ SWIG_From_int (int value)
1880
+ {
1881
+ return SWIG_From_long (value);
1882
+ }
1883
+
1884
+
1885
+ SWIGINTERNINLINE VALUE
1886
+ SWIG_From_unsigned_SS_long (unsigned long value)
1887
+ {
1888
+ return ULONG2NUM(value);
1889
+ }
1890
+
1891
+
1892
+ SWIGINTERNINLINE VALUE
1893
+ SWIG_From_size_t (size_t value)
1894
+ {
1895
+ return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
1896
+ }
1897
+
1898
+
1899
+ #define SWIG_From_double rb_float_new
1900
+
1901
+
1902
+ SWIGINTERNINLINE VALUE
1903
+ SWIG_From_float (float value)
1904
+ {
1905
+ return SWIG_From_double (value);
1906
+ }
1907
+
1908
+
1909
+ SWIGINTERN swig_type_info*
1910
+ SWIG_pchar_descriptor(void)
1911
+ {
1912
+ static int init = 0;
1913
+ static swig_type_info* info = 0;
1914
+ if (!init) {
1915
+ info = SWIG_TypeQuery("_p_char");
1916
+ init = 1;
1917
+ }
1918
+ return info;
1919
+ }
1920
+
1921
+
1922
+ SWIGINTERNINLINE VALUE
1923
+ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1924
+ {
1925
+ if (carray) {
1926
+ if (size > LONG_MAX) {
1927
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1928
+ return pchar_descriptor ?
1929
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
1930
+ } else {
1931
+ return rb_str_new(carray, static_cast< long >(size));
1932
+ }
1933
+ } else {
1934
+ return Qnil;
1935
+ }
1936
+ }
1937
+
1938
+
1939
+ SWIGINTERNINLINE VALUE
1940
+ SWIG_FromCharPtr(const char *cptr)
1941
+ {
1942
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1943
+ }
1944
+
1945
+
1946
+ SWIGINTERNINLINE VALUE
1947
+ SWIG_From_unsigned_SS_short (unsigned short value)
1948
+ {
1949
+ return SWIG_From_unsigned_SS_long (value);
1950
+ }
1951
+
1952
+
1953
+ SWIGINTERN VALUE
1954
+ SWIG_ruby_failed(void)
1955
+ {
1956
+ return Qnil;
1957
+ }
1958
+
1959
+
1960
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1961
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1962
+ {
1963
+ VALUE obj = args[0];
1964
+ VALUE type = TYPE(obj);
1965
+ unsigned long *res = (unsigned long *)(args[1]);
1966
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
1967
+ return obj;
1968
+ }
1969
+ /*@SWIG@*/
1970
+
1971
+ SWIGINTERN int
1972
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1973
+ {
1974
+ VALUE type = TYPE(obj);
1975
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1976
+ unsigned long v;
1977
+ VALUE a[2];
1978
+ a[0] = obj;
1979
+ a[1] = (VALUE)(&v);
1980
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1981
+ if (val) *val = v;
1982
+ return SWIG_OK;
1983
+ }
1984
+ }
1985
+ return SWIG_TypeError;
1986
+ }
1987
+
1988
+
1989
+ SWIGINTERNINLINE int
1990
+ SWIG_AsVal_size_t (VALUE obj, size_t *val)
1991
+ {
1992
+ unsigned long v;
1993
+ int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
1994
+ if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
1995
+ return res;
1996
+ }
1997
+
1998
+ SWIGINTERN char const *cabocha_chunk_t_feature_list(cabocha_chunk_t *self,size_t i){
1999
+ if (self->feature_list_size < i)
2000
+ throw "index is out of range";
2001
+ return self->feature_list[i];
2002
+ }
2003
+ SWIGINTERN char const *cabocha_token_t_feature_list(cabocha_token_t *self,size_t i){
2004
+ if (self->feature_list_size < i)
2005
+ throw "index is out of range";
2006
+ return self->feature_list[i];
2007
+ }
2008
+
2009
+ SWIGINTERN int
2010
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
2011
+ {
2012
+ if (TYPE(obj) == T_STRING) {
2013
+ char *cstr = StringValuePtr(obj);
2014
+ size_t size = RSTRING_LEN(obj) + 1;
2015
+ if (cptr) {
2016
+ if (alloc) {
2017
+ if (*alloc == SWIG_NEWOBJ) {
2018
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
2019
+ } else {
2020
+ *cptr = cstr;
2021
+ *alloc = SWIG_OLDOBJ;
2022
+ }
2023
+ }
2024
+ }
2025
+ if (psize) *psize = size;
2026
+ return SWIG_OK;
2027
+ } else {
2028
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2029
+ if (pchar_descriptor) {
2030
+ void* vptr = 0;
2031
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2032
+ if (cptr) *cptr = (char *)vptr;
2033
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
2034
+ if (alloc) *alloc = SWIG_OLDOBJ;
2035
+ return SWIG_OK;
2036
+ }
2037
+ }
2038
+ }
2039
+ return SWIG_TypeError;
2040
+ }
2041
+
2042
+
2043
+
2044
+
2045
+
2046
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2047
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2048
+ {
2049
+ VALUE obj = args[0];
2050
+ VALUE type = TYPE(obj);
2051
+ long *res = (long *)(args[1]);
2052
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
2053
+ return obj;
2054
+ }
2055
+ /*@SWIG@*/
2056
+
2057
+ SWIGINTERN int
2058
+ SWIG_AsVal_long (VALUE obj, long* val)
2059
+ {
2060
+ VALUE type = TYPE(obj);
2061
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2062
+ long v;
2063
+ VALUE a[2];
2064
+ a[0] = obj;
2065
+ a[1] = (VALUE)(&v);
2066
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2067
+ if (val) *val = v;
2068
+ return SWIG_OK;
2069
+ }
2070
+ }
2071
+ return SWIG_TypeError;
2072
+ }
2073
+
2074
+
2075
+ SWIGINTERN int
2076
+ SWIG_AsVal_int (VALUE obj, int *val)
2077
+ {
2078
+ long v;
2079
+ int res = SWIG_AsVal_long (obj, &v);
2080
+ if (SWIG_IsOK(res)) {
2081
+ if ((v < INT_MIN || v > INT_MAX)) {
2082
+ return SWIG_OverflowError;
2083
+ } else {
2084
+ if (val) *val = static_cast< int >(v);
2085
+ }
2086
+ }
2087
+ return res;
2088
+ }
2089
+
2090
+
2091
+ SWIGINTERNINLINE VALUE
2092
+ SWIG_From_bool (bool value)
2093
+ {
2094
+ return value ? Qtrue : Qfalse;
2095
+ }
2096
+
2097
+
2098
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2099
+ SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
2100
+ {
2101
+ VALUE obj = args[0];
2102
+ VALUE type = TYPE(obj);
2103
+ double *res = (double *)(args[1]);
2104
+ *res = NUM2DBL(obj);
2105
+ return obj;
2106
+ }
2107
+ /*@SWIG@*/
2108
+
2109
+ SWIGINTERN int
2110
+ SWIG_AsVal_double (VALUE obj, double *val)
2111
+ {
2112
+ VALUE type = TYPE(obj);
2113
+ if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
2114
+ double v;
2115
+ VALUE a[2];
2116
+ a[0] = obj;
2117
+ a[1] = (VALUE)(&v);
2118
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2119
+ if (val) *val = v;
2120
+ return SWIG_OK;
2121
+ }
2122
+ }
2123
+ return SWIG_TypeError;
2124
+ }
2125
+
2126
+ static swig_class SwigClassChunk;
2127
+
2128
+ SWIGINTERN VALUE
2129
+ _wrap_Chunk_link_get(int argc, VALUE *argv, VALUE self) {
2130
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2131
+ void *argp1 = 0 ;
2132
+ int res1 = 0 ;
2133
+ int result;
2134
+ VALUE vresult = Qnil;
2135
+
2136
+ if ((argc < 0) || (argc > 0)) {
2137
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2138
+ }
2139
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2140
+ if (!SWIG_IsOK(res1)) {
2141
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","link", 1, self ));
2142
+ }
2143
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2144
+ result = (int) ((arg1)->link);
2145
+ vresult = SWIG_From_int(static_cast< int >(result));
2146
+ return vresult;
2147
+ fail:
2148
+ return Qnil;
2149
+ }
2150
+
2151
+
2152
+ SWIGINTERN VALUE
2153
+ _wrap_Chunk_head_pos_get(int argc, VALUE *argv, VALUE self) {
2154
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2155
+ void *argp1 = 0 ;
2156
+ int res1 = 0 ;
2157
+ size_t result;
2158
+ VALUE vresult = Qnil;
2159
+
2160
+ if ((argc < 0) || (argc > 0)) {
2161
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2162
+ }
2163
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2164
+ if (!SWIG_IsOK(res1)) {
2165
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","head_pos", 1, self ));
2166
+ }
2167
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2168
+ result = ((arg1)->head_pos);
2169
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2170
+ return vresult;
2171
+ fail:
2172
+ return Qnil;
2173
+ }
2174
+
2175
+
2176
+ SWIGINTERN VALUE
2177
+ _wrap_Chunk_func_pos_get(int argc, VALUE *argv, VALUE self) {
2178
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2179
+ void *argp1 = 0 ;
2180
+ int res1 = 0 ;
2181
+ size_t result;
2182
+ VALUE vresult = Qnil;
2183
+
2184
+ if ((argc < 0) || (argc > 0)) {
2185
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2186
+ }
2187
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2188
+ if (!SWIG_IsOK(res1)) {
2189
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","func_pos", 1, self ));
2190
+ }
2191
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2192
+ result = ((arg1)->func_pos);
2193
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2194
+ return vresult;
2195
+ fail:
2196
+ return Qnil;
2197
+ }
2198
+
2199
+
2200
+ SWIGINTERN VALUE
2201
+ _wrap_Chunk_token_size_get(int argc, VALUE *argv, VALUE self) {
2202
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2203
+ void *argp1 = 0 ;
2204
+ int res1 = 0 ;
2205
+ size_t result;
2206
+ VALUE vresult = Qnil;
2207
+
2208
+ if ((argc < 0) || (argc > 0)) {
2209
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2210
+ }
2211
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2212
+ if (!SWIG_IsOK(res1)) {
2213
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","token_size", 1, self ));
2214
+ }
2215
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2216
+ result = ((arg1)->token_size);
2217
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2218
+ return vresult;
2219
+ fail:
2220
+ return Qnil;
2221
+ }
2222
+
2223
+
2224
+ SWIGINTERN VALUE
2225
+ _wrap_Chunk_token_pos_get(int argc, VALUE *argv, VALUE self) {
2226
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2227
+ void *argp1 = 0 ;
2228
+ int res1 = 0 ;
2229
+ size_t result;
2230
+ VALUE vresult = Qnil;
2231
+
2232
+ if ((argc < 0) || (argc > 0)) {
2233
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2234
+ }
2235
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2236
+ if (!SWIG_IsOK(res1)) {
2237
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","token_pos", 1, self ));
2238
+ }
2239
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2240
+ result = ((arg1)->token_pos);
2241
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2242
+ return vresult;
2243
+ fail:
2244
+ return Qnil;
2245
+ }
2246
+
2247
+
2248
+ SWIGINTERN VALUE
2249
+ _wrap_Chunk_score_get(int argc, VALUE *argv, VALUE self) {
2250
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2251
+ void *argp1 = 0 ;
2252
+ int res1 = 0 ;
2253
+ float result;
2254
+ VALUE vresult = Qnil;
2255
+
2256
+ if ((argc < 0) || (argc > 0)) {
2257
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2258
+ }
2259
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2260
+ if (!SWIG_IsOK(res1)) {
2261
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","score", 1, self ));
2262
+ }
2263
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2264
+ result = (float) ((arg1)->score);
2265
+ vresult = SWIG_From_float(static_cast< float >(result));
2266
+ return vresult;
2267
+ fail:
2268
+ return Qnil;
2269
+ }
2270
+
2271
+
2272
+ SWIGINTERN VALUE
2273
+ _wrap_Chunk_additional_info_get(int argc, VALUE *argv, VALUE self) {
2274
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2275
+ void *argp1 = 0 ;
2276
+ int res1 = 0 ;
2277
+ char *result = 0 ;
2278
+ VALUE vresult = Qnil;
2279
+
2280
+ if ((argc < 0) || (argc > 0)) {
2281
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2282
+ }
2283
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2284
+ if (!SWIG_IsOK(res1)) {
2285
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","additional_info", 1, self ));
2286
+ }
2287
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2288
+ result = (char *) ((arg1)->additional_info);
2289
+ vresult = SWIG_FromCharPtr((const char *)result);
2290
+ return vresult;
2291
+ fail:
2292
+ return Qnil;
2293
+ }
2294
+
2295
+
2296
+ SWIGINTERN VALUE
2297
+ _wrap_Chunk_feature_list_size_get(int argc, VALUE *argv, VALUE self) {
2298
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2299
+ void *argp1 = 0 ;
2300
+ int res1 = 0 ;
2301
+ unsigned short result;
2302
+ VALUE vresult = Qnil;
2303
+
2304
+ if ((argc < 0) || (argc > 0)) {
2305
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2306
+ }
2307
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2308
+ if (!SWIG_IsOK(res1)) {
2309
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","feature_list_size", 1, self ));
2310
+ }
2311
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2312
+ result = (unsigned short) ((arg1)->feature_list_size);
2313
+ vresult = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result));
2314
+ return vresult;
2315
+ fail:
2316
+ return Qnil;
2317
+ }
2318
+
2319
+
2320
+ SWIGINTERN VALUE
2321
+ _wrap_Chunk_feature_list(int argc, VALUE *argv, VALUE self) {
2322
+ cabocha_chunk_t *arg1 = (cabocha_chunk_t *) 0 ;
2323
+ size_t arg2 ;
2324
+ void *argp1 = 0 ;
2325
+ int res1 = 0 ;
2326
+ size_t val2 ;
2327
+ int ecode2 = 0 ;
2328
+ char *result = 0 ;
2329
+ VALUE vresult = Qnil;
2330
+
2331
+ if ((argc < 1) || (argc > 1)) {
2332
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2333
+ }
2334
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2335
+ if (!SWIG_IsOK(res1)) {
2336
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_chunk_t *","feature_list", 1, self ));
2337
+ }
2338
+ arg1 = reinterpret_cast< cabocha_chunk_t * >(argp1);
2339
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
2340
+ if (!SWIG_IsOK(ecode2)) {
2341
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","feature_list", 2, argv[0] ));
2342
+ }
2343
+ arg2 = static_cast< size_t >(val2);
2344
+ {
2345
+ try {
2346
+ result = (char *)cabocha_chunk_t_feature_list(arg1,arg2);
2347
+ }
2348
+ catch (char *e) {
2349
+ SWIG_exception (SWIG_RuntimeError, e);
2350
+ }
2351
+ catch (const char *e) {
2352
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2353
+ }
2354
+ }
2355
+ vresult = SWIG_FromCharPtr((const char *)result);
2356
+ return vresult;
2357
+ fail:
2358
+ return Qnil;
2359
+ }
2360
+
2361
+
2362
+ static swig_class SwigClassToken;
2363
+
2364
+ SWIGINTERN VALUE
2365
+ _wrap_Token_surface_get(int argc, VALUE *argv, VALUE self) {
2366
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2367
+ void *argp1 = 0 ;
2368
+ int res1 = 0 ;
2369
+ char *result = 0 ;
2370
+ VALUE vresult = Qnil;
2371
+
2372
+ if ((argc < 0) || (argc > 0)) {
2373
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2374
+ }
2375
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2376
+ if (!SWIG_IsOK(res1)) {
2377
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","surface", 1, self ));
2378
+ }
2379
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2380
+ result = (char *) ((arg1)->surface);
2381
+ vresult = SWIG_FromCharPtr((const char *)result);
2382
+ return vresult;
2383
+ fail:
2384
+ return Qnil;
2385
+ }
2386
+
2387
+
2388
+ SWIGINTERN VALUE
2389
+ _wrap_Token_normalized_surface_get(int argc, VALUE *argv, VALUE self) {
2390
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2391
+ void *argp1 = 0 ;
2392
+ int res1 = 0 ;
2393
+ char *result = 0 ;
2394
+ VALUE vresult = Qnil;
2395
+
2396
+ if ((argc < 0) || (argc > 0)) {
2397
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2398
+ }
2399
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2400
+ if (!SWIG_IsOK(res1)) {
2401
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","normalized_surface", 1, self ));
2402
+ }
2403
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2404
+ result = (char *) ((arg1)->normalized_surface);
2405
+ vresult = SWIG_FromCharPtr((const char *)result);
2406
+ return vresult;
2407
+ fail:
2408
+ return Qnil;
2409
+ }
2410
+
2411
+
2412
+ SWIGINTERN VALUE
2413
+ _wrap_Token_feature_get(int argc, VALUE *argv, VALUE self) {
2414
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2415
+ void *argp1 = 0 ;
2416
+ int res1 = 0 ;
2417
+ char *result = 0 ;
2418
+ VALUE vresult = Qnil;
2419
+
2420
+ if ((argc < 0) || (argc > 0)) {
2421
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2422
+ }
2423
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2424
+ if (!SWIG_IsOK(res1)) {
2425
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","feature", 1, self ));
2426
+ }
2427
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2428
+ result = (char *) ((arg1)->feature);
2429
+ vresult = SWIG_FromCharPtr((const char *)result);
2430
+ return vresult;
2431
+ fail:
2432
+ return Qnil;
2433
+ }
2434
+
2435
+
2436
+ SWIGINTERN VALUE
2437
+ _wrap_Token_feature_list_size_get(int argc, VALUE *argv, VALUE self) {
2438
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2439
+ void *argp1 = 0 ;
2440
+ int res1 = 0 ;
2441
+ unsigned short result;
2442
+ VALUE vresult = Qnil;
2443
+
2444
+ if ((argc < 0) || (argc > 0)) {
2445
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2446
+ }
2447
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2448
+ if (!SWIG_IsOK(res1)) {
2449
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","feature_list_size", 1, self ));
2450
+ }
2451
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2452
+ result = (unsigned short) ((arg1)->feature_list_size);
2453
+ vresult = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result));
2454
+ return vresult;
2455
+ fail:
2456
+ return Qnil;
2457
+ }
2458
+
2459
+
2460
+ SWIGINTERN VALUE
2461
+ _wrap_Token_ne_get(int argc, VALUE *argv, VALUE self) {
2462
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2463
+ void *argp1 = 0 ;
2464
+ int res1 = 0 ;
2465
+ char *result = 0 ;
2466
+ VALUE vresult = Qnil;
2467
+
2468
+ if ((argc < 0) || (argc > 0)) {
2469
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2470
+ }
2471
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2472
+ if (!SWIG_IsOK(res1)) {
2473
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","ne", 1, self ));
2474
+ }
2475
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2476
+ result = (char *) ((arg1)->ne);
2477
+ vresult = SWIG_FromCharPtr((const char *)result);
2478
+ return vresult;
2479
+ fail:
2480
+ return Qnil;
2481
+ }
2482
+
2483
+
2484
+ SWIGINTERN VALUE
2485
+ _wrap_Token_additional_info_get(int argc, VALUE *argv, VALUE self) {
2486
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2487
+ void *argp1 = 0 ;
2488
+ int res1 = 0 ;
2489
+ char *result = 0 ;
2490
+ VALUE vresult = Qnil;
2491
+
2492
+ if ((argc < 0) || (argc > 0)) {
2493
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2494
+ }
2495
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2496
+ if (!SWIG_IsOK(res1)) {
2497
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","additional_info", 1, self ));
2498
+ }
2499
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2500
+ result = (char *) ((arg1)->additional_info);
2501
+ vresult = SWIG_FromCharPtr((const char *)result);
2502
+ return vresult;
2503
+ fail:
2504
+ return Qnil;
2505
+ }
2506
+
2507
+
2508
+ SWIGINTERN VALUE
2509
+ _wrap_Token_chunk_get(int argc, VALUE *argv, VALUE self) {
2510
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2511
+ void *argp1 = 0 ;
2512
+ int res1 = 0 ;
2513
+ cabocha_chunk_t *result = 0 ;
2514
+ VALUE vresult = Qnil;
2515
+
2516
+ if ((argc < 0) || (argc > 0)) {
2517
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2518
+ }
2519
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2520
+ if (!SWIG_IsOK(res1)) {
2521
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","chunk", 1, self ));
2522
+ }
2523
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2524
+ result = (cabocha_chunk_t *) ((arg1)->chunk);
2525
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2526
+ return vresult;
2527
+ fail:
2528
+ return Qnil;
2529
+ }
2530
+
2531
+
2532
+ SWIGINTERN VALUE
2533
+ _wrap_Token_feature_list(int argc, VALUE *argv, VALUE self) {
2534
+ cabocha_token_t *arg1 = (cabocha_token_t *) 0 ;
2535
+ size_t arg2 ;
2536
+ void *argp1 = 0 ;
2537
+ int res1 = 0 ;
2538
+ size_t val2 ;
2539
+ int ecode2 = 0 ;
2540
+ char *result = 0 ;
2541
+ VALUE vresult = Qnil;
2542
+
2543
+ if ((argc < 1) || (argc > 1)) {
2544
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2545
+ }
2546
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2547
+ if (!SWIG_IsOK(res1)) {
2548
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "cabocha_token_t *","feature_list", 1, self ));
2549
+ }
2550
+ arg1 = reinterpret_cast< cabocha_token_t * >(argp1);
2551
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
2552
+ if (!SWIG_IsOK(ecode2)) {
2553
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","feature_list", 2, argv[0] ));
2554
+ }
2555
+ arg2 = static_cast< size_t >(val2);
2556
+ {
2557
+ try {
2558
+ result = (char *)cabocha_token_t_feature_list(arg1,arg2);
2559
+ }
2560
+ catch (char *e) {
2561
+ SWIG_exception (SWIG_RuntimeError, e);
2562
+ }
2563
+ catch (const char *e) {
2564
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2565
+ }
2566
+ }
2567
+ vresult = SWIG_FromCharPtr((const char *)result);
2568
+ return vresult;
2569
+ fail:
2570
+ return Qnil;
2571
+ }
2572
+
2573
+
2574
+ static swig_class SwigClassTree;
2575
+
2576
+ SWIGINTERN VALUE
2577
+ _wrap_Tree_set_sentence(int argc, VALUE *argv, VALUE self) {
2578
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2579
+ char *arg2 = (char *) 0 ;
2580
+ void *argp1 = 0 ;
2581
+ int res1 = 0 ;
2582
+ int res2 ;
2583
+ char *buf2 = 0 ;
2584
+ int alloc2 = 0 ;
2585
+
2586
+ if ((argc < 1) || (argc > 1)) {
2587
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2588
+ }
2589
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2590
+ if (!SWIG_IsOK(res1)) {
2591
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","set_sentence", 1, self ));
2592
+ }
2593
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2594
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2595
+ if (!SWIG_IsOK(res2)) {
2596
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","set_sentence", 2, argv[0] ));
2597
+ }
2598
+ arg2 = reinterpret_cast< char * >(buf2);
2599
+ {
2600
+ try {
2601
+ (arg1)->set_sentence((char const *)arg2);
2602
+ }
2603
+ catch (char *e) {
2604
+ SWIG_exception (SWIG_RuntimeError, e);
2605
+ }
2606
+ catch (const char *e) {
2607
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2608
+ }
2609
+ }
2610
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2611
+ return Qnil;
2612
+ fail:
2613
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2614
+ return Qnil;
2615
+ }
2616
+
2617
+
2618
+ SWIGINTERN VALUE
2619
+ _wrap_Tree_sentence(int argc, VALUE *argv, VALUE self) {
2620
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2621
+ void *argp1 = 0 ;
2622
+ int res1 = 0 ;
2623
+ char *result = 0 ;
2624
+ VALUE vresult = Qnil;
2625
+
2626
+ if ((argc < 0) || (argc > 0)) {
2627
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2628
+ }
2629
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2630
+ if (!SWIG_IsOK(res1)) {
2631
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","sentence", 1, self ));
2632
+ }
2633
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2634
+ {
2635
+ try {
2636
+ result = (char *)((CaboCha::Tree const *)arg1)->sentence();
2637
+ }
2638
+ catch (char *e) {
2639
+ SWIG_exception (SWIG_RuntimeError, e);
2640
+ }
2641
+ catch (const char *e) {
2642
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2643
+ }
2644
+ }
2645
+ vresult = SWIG_FromCharPtr((const char *)result);
2646
+ return vresult;
2647
+ fail:
2648
+ return Qnil;
2649
+ }
2650
+
2651
+
2652
+ SWIGINTERN VALUE
2653
+ _wrap_Tree_sentence_size(int argc, VALUE *argv, VALUE self) {
2654
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2655
+ void *argp1 = 0 ;
2656
+ int res1 = 0 ;
2657
+ size_t result;
2658
+ VALUE vresult = Qnil;
2659
+
2660
+ if ((argc < 0) || (argc > 0)) {
2661
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2662
+ }
2663
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2664
+ if (!SWIG_IsOK(res1)) {
2665
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","sentence_size", 1, self ));
2666
+ }
2667
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2668
+ {
2669
+ try {
2670
+ result = ((CaboCha::Tree const *)arg1)->sentence_size();
2671
+ }
2672
+ catch (char *e) {
2673
+ SWIG_exception (SWIG_RuntimeError, e);
2674
+ }
2675
+ catch (const char *e) {
2676
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2677
+ }
2678
+ }
2679
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2680
+ return vresult;
2681
+ fail:
2682
+ return Qnil;
2683
+ }
2684
+
2685
+
2686
+ SWIGINTERN VALUE
2687
+ _wrap_Tree_chunk(int argc, VALUE *argv, VALUE self) {
2688
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2689
+ size_t arg2 ;
2690
+ void *argp1 = 0 ;
2691
+ int res1 = 0 ;
2692
+ size_t val2 ;
2693
+ int ecode2 = 0 ;
2694
+ CaboCha::Chunk *result = 0 ;
2695
+ VALUE vresult = Qnil;
2696
+
2697
+ if ((argc < 1) || (argc > 1)) {
2698
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2699
+ }
2700
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2701
+ if (!SWIG_IsOK(res1)) {
2702
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","chunk", 1, self ));
2703
+ }
2704
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2705
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
2706
+ if (!SWIG_IsOK(ecode2)) {
2707
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","chunk", 2, argv[0] ));
2708
+ }
2709
+ arg2 = static_cast< size_t >(val2);
2710
+ {
2711
+ try {
2712
+ result = (CaboCha::Chunk *)((CaboCha::Tree const *)arg1)->chunk(arg2);
2713
+ }
2714
+ catch (char *e) {
2715
+ SWIG_exception (SWIG_RuntimeError, e);
2716
+ }
2717
+ catch (const char *e) {
2718
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2719
+ }
2720
+ }
2721
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_cabocha_chunk_t, 0 | 0 );
2722
+ return vresult;
2723
+ fail:
2724
+ return Qnil;
2725
+ }
2726
+
2727
+
2728
+ SWIGINTERN VALUE
2729
+ _wrap_Tree_token(int argc, VALUE *argv, VALUE self) {
2730
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2731
+ size_t arg2 ;
2732
+ void *argp1 = 0 ;
2733
+ int res1 = 0 ;
2734
+ size_t val2 ;
2735
+ int ecode2 = 0 ;
2736
+ CaboCha::Token *result = 0 ;
2737
+ VALUE vresult = Qnil;
2738
+
2739
+ if ((argc < 1) || (argc > 1)) {
2740
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2741
+ }
2742
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2743
+ if (!SWIG_IsOK(res1)) {
2744
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","token", 1, self ));
2745
+ }
2746
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2747
+ ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
2748
+ if (!SWIG_IsOK(ecode2)) {
2749
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","token", 2, argv[0] ));
2750
+ }
2751
+ arg2 = static_cast< size_t >(val2);
2752
+ {
2753
+ try {
2754
+ result = (CaboCha::Token *)((CaboCha::Tree const *)arg1)->token(arg2);
2755
+ }
2756
+ catch (char *e) {
2757
+ SWIG_exception (SWIG_RuntimeError, e);
2758
+ }
2759
+ catch (const char *e) {
2760
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2761
+ }
2762
+ }
2763
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_cabocha_token_t, 0 | 0 );
2764
+ return vresult;
2765
+ fail:
2766
+ return Qnil;
2767
+ }
2768
+
2769
+
2770
+ SWIGINTERN VALUE
2771
+ _wrap_Tree_read(int argc, VALUE *argv, VALUE self) {
2772
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2773
+ char *arg2 = (char *) 0 ;
2774
+ CaboCha::InputLayerType arg3 ;
2775
+ void *argp1 = 0 ;
2776
+ int res1 = 0 ;
2777
+ int res2 ;
2778
+ char *buf2 = 0 ;
2779
+ int alloc2 = 0 ;
2780
+ int val3 ;
2781
+ int ecode3 = 0 ;
2782
+ bool result;
2783
+ VALUE vresult = Qnil;
2784
+
2785
+ if ((argc < 2) || (argc > 2)) {
2786
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2787
+ }
2788
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2789
+ if (!SWIG_IsOK(res1)) {
2790
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","read", 1, self ));
2791
+ }
2792
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2793
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2794
+ if (!SWIG_IsOK(res2)) {
2795
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","read", 2, argv[0] ));
2796
+ }
2797
+ arg2 = reinterpret_cast< char * >(buf2);
2798
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
2799
+ if (!SWIG_IsOK(ecode3)) {
2800
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "CaboCha::InputLayerType","read", 3, argv[1] ));
2801
+ }
2802
+ arg3 = static_cast< CaboCha::InputLayerType >(val3);
2803
+ {
2804
+ try {
2805
+ result = (bool)(arg1)->read((char const *)arg2,arg3);
2806
+ }
2807
+ catch (char *e) {
2808
+ SWIG_exception (SWIG_RuntimeError, e);
2809
+ }
2810
+ catch (const char *e) {
2811
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2812
+ }
2813
+ }
2814
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2815
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2816
+ return vresult;
2817
+ fail:
2818
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
2819
+ return Qnil;
2820
+ }
2821
+
2822
+
2823
+
2824
+ /*
2825
+ Document-method: CaboCha::Tree.empty
2826
+
2827
+ call-seq:
2828
+ empty -> bool
2829
+
2830
+ Check if Tree is empty.
2831
+ */
2832
+ SWIGINTERN VALUE
2833
+ _wrap_Tree_empty(int argc, VALUE *argv, VALUE self) {
2834
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2835
+ void *argp1 = 0 ;
2836
+ int res1 = 0 ;
2837
+ bool result;
2838
+ VALUE vresult = Qnil;
2839
+
2840
+ if ((argc < 0) || (argc > 0)) {
2841
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2842
+ }
2843
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2844
+ if (!SWIG_IsOK(res1)) {
2845
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","empty", 1, self ));
2846
+ }
2847
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2848
+ {
2849
+ try {
2850
+ result = (bool)((CaboCha::Tree const *)arg1)->empty();
2851
+ }
2852
+ catch (char *e) {
2853
+ SWIG_exception (SWIG_RuntimeError, e);
2854
+ }
2855
+ catch (const char *e) {
2856
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2857
+ }
2858
+ }
2859
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2860
+ return vresult;
2861
+ fail:
2862
+ return Qnil;
2863
+ }
2864
+
2865
+
2866
+ SWIGINTERN VALUE
2867
+ _wrap_Tree_clear(int argc, VALUE *argv, VALUE self) {
2868
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2869
+ void *argp1 = 0 ;
2870
+ int res1 = 0 ;
2871
+
2872
+ if ((argc < 0) || (argc > 0)) {
2873
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2874
+ }
2875
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2876
+ if (!SWIG_IsOK(res1)) {
2877
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","clear", 1, self ));
2878
+ }
2879
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2880
+ {
2881
+ try {
2882
+ (arg1)->clear();
2883
+ }
2884
+ catch (char *e) {
2885
+ SWIG_exception (SWIG_RuntimeError, e);
2886
+ }
2887
+ catch (const char *e) {
2888
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2889
+ }
2890
+ }
2891
+ return Qnil;
2892
+ fail:
2893
+ return Qnil;
2894
+ }
2895
+
2896
+
2897
+ SWIGINTERN VALUE
2898
+ _wrap_Tree_clear_chunk(int argc, VALUE *argv, VALUE self) {
2899
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2900
+ void *argp1 = 0 ;
2901
+ int res1 = 0 ;
2902
+
2903
+ if ((argc < 0) || (argc > 0)) {
2904
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2905
+ }
2906
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2907
+ if (!SWIG_IsOK(res1)) {
2908
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","clear_chunk", 1, self ));
2909
+ }
2910
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2911
+ {
2912
+ try {
2913
+ (arg1)->clear_chunk();
2914
+ }
2915
+ catch (char *e) {
2916
+ SWIG_exception (SWIG_RuntimeError, e);
2917
+ }
2918
+ catch (const char *e) {
2919
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2920
+ }
2921
+ }
2922
+ return Qnil;
2923
+ fail:
2924
+ return Qnil;
2925
+ }
2926
+
2927
+
2928
+ SWIGINTERN VALUE
2929
+ _wrap_Tree_chunk_size(int argc, VALUE *argv, VALUE self) {
2930
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2931
+ void *argp1 = 0 ;
2932
+ int res1 = 0 ;
2933
+ size_t result;
2934
+ VALUE vresult = Qnil;
2935
+
2936
+ if ((argc < 0) || (argc > 0)) {
2937
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2938
+ }
2939
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2940
+ if (!SWIG_IsOK(res1)) {
2941
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","chunk_size", 1, self ));
2942
+ }
2943
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2944
+ {
2945
+ try {
2946
+ result = ((CaboCha::Tree const *)arg1)->chunk_size();
2947
+ }
2948
+ catch (char *e) {
2949
+ SWIG_exception (SWIG_RuntimeError, e);
2950
+ }
2951
+ catch (const char *e) {
2952
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2953
+ }
2954
+ }
2955
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2956
+ return vresult;
2957
+ fail:
2958
+ return Qnil;
2959
+ }
2960
+
2961
+
2962
+ SWIGINTERN VALUE
2963
+ _wrap_Tree_token_size(int argc, VALUE *argv, VALUE self) {
2964
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
2965
+ void *argp1 = 0 ;
2966
+ int res1 = 0 ;
2967
+ size_t result;
2968
+ VALUE vresult = Qnil;
2969
+
2970
+ if ((argc < 0) || (argc > 0)) {
2971
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2972
+ }
2973
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
2974
+ if (!SWIG_IsOK(res1)) {
2975
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","token_size", 1, self ));
2976
+ }
2977
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
2978
+ {
2979
+ try {
2980
+ result = ((CaboCha::Tree const *)arg1)->token_size();
2981
+ }
2982
+ catch (char *e) {
2983
+ SWIG_exception (SWIG_RuntimeError, e);
2984
+ }
2985
+ catch (const char *e) {
2986
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
2987
+ }
2988
+ }
2989
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
2990
+ return vresult;
2991
+ fail:
2992
+ return Qnil;
2993
+ }
2994
+
2995
+
2996
+
2997
+ /*
2998
+ Document-method: CaboCha::Tree.size
2999
+
3000
+ call-seq:
3001
+ size -> size_t
3002
+
3003
+ Size or Length of the Tree.
3004
+ */
3005
+ SWIGINTERN VALUE
3006
+ _wrap_Tree_size(int argc, VALUE *argv, VALUE self) {
3007
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3008
+ void *argp1 = 0 ;
3009
+ int res1 = 0 ;
3010
+ size_t result;
3011
+ VALUE vresult = Qnil;
3012
+
3013
+ if ((argc < 0) || (argc > 0)) {
3014
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3015
+ }
3016
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3017
+ if (!SWIG_IsOK(res1)) {
3018
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","size", 1, self ));
3019
+ }
3020
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3021
+ {
3022
+ try {
3023
+ result = ((CaboCha::Tree const *)arg1)->size();
3024
+ }
3025
+ catch (char *e) {
3026
+ SWIG_exception (SWIG_RuntimeError, e);
3027
+ }
3028
+ catch (const char *e) {
3029
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3030
+ }
3031
+ }
3032
+ vresult = SWIG_From_size_t(static_cast< size_t >(result));
3033
+ return vresult;
3034
+ fail:
3035
+ return Qnil;
3036
+ }
3037
+
3038
+
3039
+ SWIGINTERN VALUE
3040
+ _wrap_Tree_toString(int argc, VALUE *argv, VALUE self) {
3041
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3042
+ CaboCha::FormatType arg2 ;
3043
+ void *argp1 = 0 ;
3044
+ int res1 = 0 ;
3045
+ int val2 ;
3046
+ int ecode2 = 0 ;
3047
+ char *result = 0 ;
3048
+ VALUE vresult = Qnil;
3049
+
3050
+ if ((argc < 1) || (argc > 1)) {
3051
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3052
+ }
3053
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3054
+ if (!SWIG_IsOK(res1)) {
3055
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","toString", 1, self ));
3056
+ }
3057
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3058
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3059
+ if (!SWIG_IsOK(ecode2)) {
3060
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "CaboCha::FormatType","toString", 2, argv[0] ));
3061
+ }
3062
+ arg2 = static_cast< CaboCha::FormatType >(val2);
3063
+ {
3064
+ try {
3065
+ result = (char *)(arg1)->toString(arg2);
3066
+ }
3067
+ catch (char *e) {
3068
+ SWIG_exception (SWIG_RuntimeError, e);
3069
+ }
3070
+ catch (const char *e) {
3071
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3072
+ }
3073
+ }
3074
+ vresult = SWIG_FromCharPtr((const char *)result);
3075
+ return vresult;
3076
+ fail:
3077
+ return Qnil;
3078
+ }
3079
+
3080
+
3081
+ SWIGINTERN VALUE
3082
+ _wrap_Tree_charset(int argc, VALUE *argv, VALUE self) {
3083
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3084
+ void *argp1 = 0 ;
3085
+ int res1 = 0 ;
3086
+ CaboCha::CharsetType result;
3087
+ VALUE vresult = Qnil;
3088
+
3089
+ if ((argc < 0) || (argc > 0)) {
3090
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3091
+ }
3092
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3093
+ if (!SWIG_IsOK(res1)) {
3094
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","charset", 1, self ));
3095
+ }
3096
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3097
+ {
3098
+ try {
3099
+ result = (CaboCha::CharsetType)((CaboCha::Tree const *)arg1)->charset();
3100
+ }
3101
+ catch (char *e) {
3102
+ SWIG_exception (SWIG_RuntimeError, e);
3103
+ }
3104
+ catch (const char *e) {
3105
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3106
+ }
3107
+ }
3108
+ vresult = SWIG_From_int(static_cast< int >(result));
3109
+ return vresult;
3110
+ fail:
3111
+ return Qnil;
3112
+ }
3113
+
3114
+
3115
+ SWIGINTERN VALUE
3116
+ _wrap_Tree_set_charset(int argc, VALUE *argv, VALUE self) {
3117
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3118
+ CaboCha::CharsetType arg2 ;
3119
+ void *argp1 = 0 ;
3120
+ int res1 = 0 ;
3121
+ int val2 ;
3122
+ int ecode2 = 0 ;
3123
+
3124
+ if ((argc < 1) || (argc > 1)) {
3125
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3126
+ }
3127
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3128
+ if (!SWIG_IsOK(res1)) {
3129
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","set_charset", 1, self ));
3130
+ }
3131
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3132
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3133
+ if (!SWIG_IsOK(ecode2)) {
3134
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "CaboCha::CharsetType","set_charset", 2, argv[0] ));
3135
+ }
3136
+ arg2 = static_cast< CaboCha::CharsetType >(val2);
3137
+ {
3138
+ try {
3139
+ (arg1)->set_charset(arg2);
3140
+ }
3141
+ catch (char *e) {
3142
+ SWIG_exception (SWIG_RuntimeError, e);
3143
+ }
3144
+ catch (const char *e) {
3145
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3146
+ }
3147
+ }
3148
+ return Qnil;
3149
+ fail:
3150
+ return Qnil;
3151
+ }
3152
+
3153
+
3154
+ SWIGINTERN VALUE
3155
+ _wrap_Tree_posset(int argc, VALUE *argv, VALUE self) {
3156
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3157
+ void *argp1 = 0 ;
3158
+ int res1 = 0 ;
3159
+ CaboCha::PossetType result;
3160
+ VALUE vresult = Qnil;
3161
+
3162
+ if ((argc < 0) || (argc > 0)) {
3163
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3164
+ }
3165
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3166
+ if (!SWIG_IsOK(res1)) {
3167
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","posset", 1, self ));
3168
+ }
3169
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3170
+ {
3171
+ try {
3172
+ result = (CaboCha::PossetType)((CaboCha::Tree const *)arg1)->posset();
3173
+ }
3174
+ catch (char *e) {
3175
+ SWIG_exception (SWIG_RuntimeError, e);
3176
+ }
3177
+ catch (const char *e) {
3178
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3179
+ }
3180
+ }
3181
+ vresult = SWIG_From_int(static_cast< int >(result));
3182
+ return vresult;
3183
+ fail:
3184
+ return Qnil;
3185
+ }
3186
+
3187
+
3188
+ SWIGINTERN VALUE
3189
+ _wrap_Tree_set_posset(int argc, VALUE *argv, VALUE self) {
3190
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3191
+ CaboCha::PossetType arg2 ;
3192
+ void *argp1 = 0 ;
3193
+ int res1 = 0 ;
3194
+ int val2 ;
3195
+ int ecode2 = 0 ;
3196
+
3197
+ if ((argc < 1) || (argc > 1)) {
3198
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3199
+ }
3200
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3201
+ if (!SWIG_IsOK(res1)) {
3202
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","set_posset", 1, self ));
3203
+ }
3204
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3205
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3206
+ if (!SWIG_IsOK(ecode2)) {
3207
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "CaboCha::PossetType","set_posset", 2, argv[0] ));
3208
+ }
3209
+ arg2 = static_cast< CaboCha::PossetType >(val2);
3210
+ {
3211
+ try {
3212
+ (arg1)->set_posset(arg2);
3213
+ }
3214
+ catch (char *e) {
3215
+ SWIG_exception (SWIG_RuntimeError, e);
3216
+ }
3217
+ catch (const char *e) {
3218
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3219
+ }
3220
+ }
3221
+ return Qnil;
3222
+ fail:
3223
+ return Qnil;
3224
+ }
3225
+
3226
+
3227
+ SWIGINTERN VALUE
3228
+ _wrap_Tree_output_layer(int argc, VALUE *argv, VALUE self) {
3229
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3230
+ void *argp1 = 0 ;
3231
+ int res1 = 0 ;
3232
+ CaboCha::OutputLayerType result;
3233
+ VALUE vresult = Qnil;
3234
+
3235
+ if ((argc < 0) || (argc > 0)) {
3236
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3237
+ }
3238
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3239
+ if (!SWIG_IsOK(res1)) {
3240
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree const *","output_layer", 1, self ));
3241
+ }
3242
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3243
+ {
3244
+ try {
3245
+ result = (CaboCha::OutputLayerType)((CaboCha::Tree const *)arg1)->output_layer();
3246
+ }
3247
+ catch (char *e) {
3248
+ SWIG_exception (SWIG_RuntimeError, e);
3249
+ }
3250
+ catch (const char *e) {
3251
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3252
+ }
3253
+ }
3254
+ vresult = SWIG_From_int(static_cast< int >(result));
3255
+ return vresult;
3256
+ fail:
3257
+ return Qnil;
3258
+ }
3259
+
3260
+
3261
+ SWIGINTERN VALUE
3262
+ _wrap_Tree_set_output_layer(int argc, VALUE *argv, VALUE self) {
3263
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3264
+ CaboCha::OutputLayerType arg2 ;
3265
+ void *argp1 = 0 ;
3266
+ int res1 = 0 ;
3267
+ int val2 ;
3268
+ int ecode2 = 0 ;
3269
+
3270
+ if ((argc < 1) || (argc > 1)) {
3271
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3272
+ }
3273
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3274
+ if (!SWIG_IsOK(res1)) {
3275
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","set_output_layer", 1, self ));
3276
+ }
3277
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3278
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3279
+ if (!SWIG_IsOK(ecode2)) {
3280
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "CaboCha::OutputLayerType","set_output_layer", 2, argv[0] ));
3281
+ }
3282
+ arg2 = static_cast< CaboCha::OutputLayerType >(val2);
3283
+ {
3284
+ try {
3285
+ (arg1)->set_output_layer(arg2);
3286
+ }
3287
+ catch (char *e) {
3288
+ SWIG_exception (SWIG_RuntimeError, e);
3289
+ }
3290
+ catch (const char *e) {
3291
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3292
+ }
3293
+ }
3294
+ return Qnil;
3295
+ fail:
3296
+ return Qnil;
3297
+ }
3298
+
3299
+
3300
+ SWIGINTERN VALUE
3301
+ _wrap_Tree_what(int argc, VALUE *argv, VALUE self) {
3302
+ CaboCha::Tree *arg1 = (CaboCha::Tree *) 0 ;
3303
+ void *argp1 = 0 ;
3304
+ int res1 = 0 ;
3305
+ char *result = 0 ;
3306
+ VALUE vresult = Qnil;
3307
+
3308
+ if ((argc < 0) || (argc > 0)) {
3309
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3310
+ }
3311
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3312
+ if (!SWIG_IsOK(res1)) {
3313
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Tree *","what", 1, self ));
3314
+ }
3315
+ arg1 = reinterpret_cast< CaboCha::Tree * >(argp1);
3316
+ {
3317
+ try {
3318
+ result = (char *)(arg1)->what();
3319
+ }
3320
+ catch (char *e) {
3321
+ SWIG_exception (SWIG_RuntimeError, e);
3322
+ }
3323
+ catch (const char *e) {
3324
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3325
+ }
3326
+ }
3327
+ vresult = SWIG_FromCharPtr((const char *)result);
3328
+ return vresult;
3329
+ fail:
3330
+ return Qnil;
3331
+ }
3332
+
3333
+
3334
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3335
+ SWIGINTERN VALUE
3336
+ _wrap_Tree_allocate(VALUE self) {
3337
+ #else
3338
+ SWIGINTERN VALUE
3339
+ _wrap_Tree_allocate(int argc, VALUE *argv, VALUE self) {
3340
+ #endif
3341
+
3342
+
3343
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CaboCha__Tree);
3344
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3345
+ rb_obj_call_init(vresult, argc, argv);
3346
+ #endif
3347
+ return vresult;
3348
+ }
3349
+
3350
+
3351
+ SWIGINTERN VALUE
3352
+ _wrap_new_Tree(int argc, VALUE *argv, VALUE self) {
3353
+ CaboCha::Tree *result = 0 ;
3354
+
3355
+ if ((argc < 0) || (argc > 0)) {
3356
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3357
+ }
3358
+ {
3359
+ try {
3360
+ result = (CaboCha::Tree *)new CaboCha::Tree();
3361
+ DATA_PTR(self) = result;
3362
+ }
3363
+ catch (char *e) {
3364
+ SWIG_exception (SWIG_RuntimeError, e);
3365
+ }
3366
+ catch (const char *e) {
3367
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3368
+ }
3369
+ }
3370
+ return self;
3371
+ fail:
3372
+ return Qnil;
3373
+ }
3374
+
3375
+
3376
+ SWIGINTERN void
3377
+ free_CaboCha_Tree(CaboCha::Tree *arg1) {
3378
+ delete arg1;
3379
+ }
3380
+
3381
+ static swig_class SwigClassParser;
3382
+
3383
+ SWIGINTERN VALUE
3384
+ _wrap_Parser_parse__SWIG_0(int argc, VALUE *argv, VALUE self) {
3385
+ CaboCha::Parser *arg1 = (CaboCha::Parser *) 0 ;
3386
+ char *arg2 = (char *) 0 ;
3387
+ void *argp1 = 0 ;
3388
+ int res1 = 0 ;
3389
+ int res2 ;
3390
+ char *buf2 = 0 ;
3391
+ int alloc2 = 0 ;
3392
+ CaboCha::Tree *result = 0 ;
3393
+ VALUE vresult = Qnil;
3394
+
3395
+ if ((argc < 1) || (argc > 1)) {
3396
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3397
+ }
3398
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Parser, 0 | 0 );
3399
+ if (!SWIG_IsOK(res1)) {
3400
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Parser *","parse", 1, self ));
3401
+ }
3402
+ arg1 = reinterpret_cast< CaboCha::Parser * >(argp1);
3403
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3404
+ if (!SWIG_IsOK(res2)) {
3405
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","parse", 2, argv[0] ));
3406
+ }
3407
+ arg2 = reinterpret_cast< char * >(buf2);
3408
+ {
3409
+ try {
3410
+ result = (CaboCha::Tree *)(arg1)->parse((char const *)arg2);
3411
+ }
3412
+ catch (char *e) {
3413
+ SWIG_exception (SWIG_RuntimeError, e);
3414
+ }
3415
+ catch (const char *e) {
3416
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3417
+ }
3418
+ }
3419
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3420
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3421
+ return vresult;
3422
+ fail:
3423
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3424
+ return Qnil;
3425
+ }
3426
+
3427
+
3428
+ SWIGINTERN VALUE
3429
+ _wrap_Parser_parseToString(int argc, VALUE *argv, VALUE self) {
3430
+ CaboCha::Parser *arg1 = (CaboCha::Parser *) 0 ;
3431
+ char *arg2 = (char *) 0 ;
3432
+ void *argp1 = 0 ;
3433
+ int res1 = 0 ;
3434
+ int res2 ;
3435
+ char *buf2 = 0 ;
3436
+ int alloc2 = 0 ;
3437
+ char *result = 0 ;
3438
+ VALUE vresult = Qnil;
3439
+
3440
+ if ((argc < 1) || (argc > 1)) {
3441
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3442
+ }
3443
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Parser, 0 | 0 );
3444
+ if (!SWIG_IsOK(res1)) {
3445
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Parser *","parseToString", 1, self ));
3446
+ }
3447
+ arg1 = reinterpret_cast< CaboCha::Parser * >(argp1);
3448
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
3449
+ if (!SWIG_IsOK(res2)) {
3450
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","parseToString", 2, argv[0] ));
3451
+ }
3452
+ arg2 = reinterpret_cast< char * >(buf2);
3453
+ {
3454
+ try {
3455
+ result = (char *)(arg1)->parseToString((char const *)arg2);
3456
+ }
3457
+ catch (char *e) {
3458
+ SWIG_exception (SWIG_RuntimeError, e);
3459
+ }
3460
+ catch (const char *e) {
3461
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3462
+ }
3463
+ }
3464
+ vresult = SWIG_FromCharPtr((const char *)result);
3465
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3466
+ return vresult;
3467
+ fail:
3468
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3469
+ return Qnil;
3470
+ }
3471
+
3472
+
3473
+ SWIGINTERN VALUE
3474
+ _wrap_Parser_parse__SWIG_1(int argc, VALUE *argv, VALUE self) {
3475
+ CaboCha::Parser *arg1 = (CaboCha::Parser *) 0 ;
3476
+ CaboCha::Tree *arg2 = (CaboCha::Tree *) 0 ;
3477
+ void *argp1 = 0 ;
3478
+ int res1 = 0 ;
3479
+ void *argp2 = 0 ;
3480
+ int res2 = 0 ;
3481
+ CaboCha::Tree *result = 0 ;
3482
+ VALUE vresult = Qnil;
3483
+
3484
+ if ((argc < 1) || (argc > 1)) {
3485
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3486
+ }
3487
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Parser, 0 | 0 );
3488
+ if (!SWIG_IsOK(res1)) {
3489
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Parser const *","parse", 1, self ));
3490
+ }
3491
+ arg1 = reinterpret_cast< CaboCha::Parser * >(argp1);
3492
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3493
+ if (!SWIG_IsOK(res2)) {
3494
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "CaboCha::Tree *","parse", 2, argv[0] ));
3495
+ }
3496
+ arg2 = reinterpret_cast< CaboCha::Tree * >(argp2);
3497
+ {
3498
+ try {
3499
+ result = (CaboCha::Tree *)((CaboCha::Parser const *)arg1)->parse(arg2);
3500
+ }
3501
+ catch (char *e) {
3502
+ SWIG_exception (SWIG_RuntimeError, e);
3503
+ }
3504
+ catch (const char *e) {
3505
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3506
+ }
3507
+ }
3508
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CaboCha__Tree, 0 | 0 );
3509
+ return vresult;
3510
+ fail:
3511
+ return Qnil;
3512
+ }
3513
+
3514
+
3515
+ SWIGINTERN VALUE _wrap_Parser_parse(int nargs, VALUE *args, VALUE self) {
3516
+ int argc;
3517
+ VALUE argv[3];
3518
+ int ii;
3519
+
3520
+ argc = nargs + 1;
3521
+ argv[0] = self;
3522
+ if (argc > 3) SWIG_fail;
3523
+ for (ii = 1; (ii < argc); ++ii) {
3524
+ argv[ii] = args[ii-1];
3525
+ }
3526
+ if (argc == 2) {
3527
+ int _v;
3528
+ void *vptr = 0;
3529
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CaboCha__Parser, 0);
3530
+ _v = SWIG_CheckState(res);
3531
+ if (_v) {
3532
+ void *vptr = 0;
3533
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CaboCha__Tree, 0);
3534
+ _v = SWIG_CheckState(res);
3535
+ if (_v) {
3536
+ return _wrap_Parser_parse__SWIG_1(nargs, args, self);
3537
+ }
3538
+ }
3539
+ }
3540
+ if (argc == 2) {
3541
+ int _v;
3542
+ void *vptr = 0;
3543
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CaboCha__Parser, 0);
3544
+ _v = SWIG_CheckState(res);
3545
+ if (_v) {
3546
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3547
+ _v = SWIG_CheckState(res);
3548
+ if (_v) {
3549
+ return _wrap_Parser_parse__SWIG_0(nargs, args, self);
3550
+ }
3551
+ }
3552
+ }
3553
+
3554
+ fail:
3555
+ Ruby_Format_OverloadedError( argc, 3, "Parser.parse",
3556
+ " CaboCha::Tree const * Parser.parse(char const *input)\n"
3557
+ " CaboCha::Tree const * Parser.parse(CaboCha::Tree *tree)\n");
3558
+
3559
+ return Qnil;
3560
+ }
3561
+
3562
+
3563
+ SWIGINTERN VALUE
3564
+ _wrap_Parser_what(int argc, VALUE *argv, VALUE self) {
3565
+ CaboCha::Parser *arg1 = (CaboCha::Parser *) 0 ;
3566
+ void *argp1 = 0 ;
3567
+ int res1 = 0 ;
3568
+ char *result = 0 ;
3569
+ VALUE vresult = Qnil;
3570
+
3571
+ if ((argc < 0) || (argc > 0)) {
3572
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3573
+ }
3574
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CaboCha__Parser, 0 | 0 );
3575
+ if (!SWIG_IsOK(res1)) {
3576
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CaboCha::Parser *","what", 1, self ));
3577
+ }
3578
+ arg1 = reinterpret_cast< CaboCha::Parser * >(argp1);
3579
+ {
3580
+ try {
3581
+ result = (char *)(arg1)->what();
3582
+ }
3583
+ catch (char *e) {
3584
+ SWIG_exception (SWIG_RuntimeError, e);
3585
+ }
3586
+ catch (const char *e) {
3587
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3588
+ }
3589
+ }
3590
+ vresult = SWIG_FromCharPtr((const char *)result);
3591
+ return vresult;
3592
+ fail:
3593
+ return Qnil;
3594
+ }
3595
+
3596
+
3597
+ SWIGINTERN VALUE
3598
+ _wrap_Parser_version(int argc, VALUE *argv, VALUE self) {
3599
+ char *result = 0 ;
3600
+ VALUE vresult = Qnil;
3601
+
3602
+ if ((argc < 0) || (argc > 0)) {
3603
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3604
+ }
3605
+ {
3606
+ try {
3607
+ result = (char *)CaboCha::Parser::version();
3608
+ }
3609
+ catch (char *e) {
3610
+ SWIG_exception (SWIG_RuntimeError, e);
3611
+ }
3612
+ catch (const char *e) {
3613
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3614
+ }
3615
+ }
3616
+ vresult = SWIG_FromCharPtr((const char *)result);
3617
+ return vresult;
3618
+ fail:
3619
+ return Qnil;
3620
+ }
3621
+
3622
+
3623
+ SWIGINTERN void
3624
+ free_CaboCha_Parser(CaboCha::Parser *arg1) {
3625
+ delete arg1;
3626
+ }
3627
+
3628
+ SWIGINTERN VALUE
3629
+ _wrap_new_Parser__SWIG_0(int argc, VALUE *argv, VALUE self) {
3630
+ char *arg1 = (char *) 0 ;
3631
+ int res1 ;
3632
+ char *buf1 = 0 ;
3633
+ int alloc1 = 0 ;
3634
+ CaboCha::Parser *result = 0 ;
3635
+
3636
+ if ((argc < 1) || (argc > 1)) {
3637
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3638
+ }
3639
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
3640
+ if (!SWIG_IsOK(res1)) {
3641
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","Parser", 1, argv[0] ));
3642
+ }
3643
+ arg1 = reinterpret_cast< char * >(buf1);
3644
+ {
3645
+ try {
3646
+ result = (CaboCha::Parser *)new_CaboCha_Parser((char const *)arg1);
3647
+ DATA_PTR(self) = result;
3648
+ }
3649
+ catch (char *e) {
3650
+ SWIG_exception (SWIG_RuntimeError, e);
3651
+ }
3652
+ catch (const char *e) {
3653
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3654
+ }
3655
+ }
3656
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3657
+ return self;
3658
+ fail:
3659
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3660
+ return Qnil;
3661
+ }
3662
+
3663
+
3664
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3665
+ SWIGINTERN VALUE
3666
+ _wrap_Parser_allocate(VALUE self) {
3667
+ #else
3668
+ SWIGINTERN VALUE
3669
+ _wrap_Parser_allocate(int argc, VALUE *argv, VALUE self) {
3670
+ #endif
3671
+
3672
+
3673
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CaboCha__Parser);
3674
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3675
+ rb_obj_call_init(vresult, argc, argv);
3676
+ #endif
3677
+ return vresult;
3678
+ }
3679
+
3680
+
3681
+ SWIGINTERN VALUE
3682
+ _wrap_new_Parser__SWIG_1(int argc, VALUE *argv, VALUE self) {
3683
+ CaboCha::Parser *result = 0 ;
3684
+
3685
+ if ((argc < 0) || (argc > 0)) {
3686
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3687
+ }
3688
+ {
3689
+ try {
3690
+ result = (CaboCha::Parser *)new_CaboCha_Parser();
3691
+ DATA_PTR(self) = result;
3692
+ }
3693
+ catch (char *e) {
3694
+ SWIG_exception (SWIG_RuntimeError, e);
3695
+ }
3696
+ catch (const char *e) {
3697
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3698
+ }
3699
+ }
3700
+ return self;
3701
+ fail:
3702
+ return Qnil;
3703
+ }
3704
+
3705
+
3706
+ SWIGINTERN VALUE _wrap_new_Parser(int nargs, VALUE *args, VALUE self) {
3707
+ int argc;
3708
+ VALUE argv[1];
3709
+ int ii;
3710
+
3711
+ argc = nargs;
3712
+ if (argc > 1) SWIG_fail;
3713
+ for (ii = 0; (ii < argc); ++ii) {
3714
+ argv[ii] = args[ii];
3715
+ }
3716
+ if (argc == 0) {
3717
+ return _wrap_new_Parser__SWIG_1(nargs, args, self);
3718
+ }
3719
+ if (argc == 1) {
3720
+ int _v;
3721
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3722
+ _v = SWIG_CheckState(res);
3723
+ if (_v) {
3724
+ return _wrap_new_Parser__SWIG_0(nargs, args, self);
3725
+ }
3726
+ }
3727
+
3728
+ fail:
3729
+ Ruby_Format_OverloadedError( argc, 1, "Parser.new",
3730
+ " Parser.new(char const *argc)\n"
3731
+ " Parser.new()\n");
3732
+
3733
+ return Qnil;
3734
+ }
3735
+
3736
+
3737
+ SWIGINTERN VALUE
3738
+ _wrap_getLastError(int argc, VALUE *argv, VALUE self) {
3739
+ char *result = 0 ;
3740
+ VALUE vresult = Qnil;
3741
+
3742
+ if ((argc < 0) || (argc > 0)) {
3743
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3744
+ }
3745
+ {
3746
+ try {
3747
+ result = (char *)CaboCha::getLastError();
3748
+ }
3749
+ catch (char *e) {
3750
+ SWIG_exception (SWIG_RuntimeError, e);
3751
+ }
3752
+ catch (const char *e) {
3753
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3754
+ }
3755
+ }
3756
+ vresult = SWIG_FromCharPtr((const char *)result);
3757
+ return vresult;
3758
+ fail:
3759
+ return Qnil;
3760
+ }
3761
+
3762
+
3763
+ SWIGINTERN VALUE
3764
+ _wrap_runDependencyTraining(int argc, VALUE *argv, VALUE self) {
3765
+ char *arg1 = (char *) 0 ;
3766
+ char *arg2 = (char *) 0 ;
3767
+ char *arg3 = (char *) 0 ;
3768
+ CaboCha::CharsetType arg4 ;
3769
+ CaboCha::PossetType arg5 ;
3770
+ double arg6 ;
3771
+ int arg7 ;
3772
+ int res1 ;
3773
+ char *buf1 = 0 ;
3774
+ int alloc1 = 0 ;
3775
+ int res2 ;
3776
+ char *buf2 = 0 ;
3777
+ int alloc2 = 0 ;
3778
+ int res3 ;
3779
+ char *buf3 = 0 ;
3780
+ int alloc3 = 0 ;
3781
+ int val4 ;
3782
+ int ecode4 = 0 ;
3783
+ int val5 ;
3784
+ int ecode5 = 0 ;
3785
+ double val6 ;
3786
+ int ecode6 = 0 ;
3787
+ int val7 ;
3788
+ int ecode7 = 0 ;
3789
+ bool result;
3790
+ VALUE vresult = Qnil;
3791
+
3792
+ if ((argc < 7) || (argc > 7)) {
3793
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail;
3794
+ }
3795
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
3796
+ if (!SWIG_IsOK(res1)) {
3797
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","CaboCha::runDependencyTraining", 1, argv[0] ));
3798
+ }
3799
+ arg1 = reinterpret_cast< char * >(buf1);
3800
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
3801
+ if (!SWIG_IsOK(res2)) {
3802
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","CaboCha::runDependencyTraining", 2, argv[1] ));
3803
+ }
3804
+ arg2 = reinterpret_cast< char * >(buf2);
3805
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
3806
+ if (!SWIG_IsOK(res3)) {
3807
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","CaboCha::runDependencyTraining", 3, argv[2] ));
3808
+ }
3809
+ arg3 = reinterpret_cast< char * >(buf3);
3810
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
3811
+ if (!SWIG_IsOK(ecode4)) {
3812
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "CaboCha::CharsetType","CaboCha::runDependencyTraining", 4, argv[3] ));
3813
+ }
3814
+ arg4 = static_cast< CaboCha::CharsetType >(val4);
3815
+ ecode5 = SWIG_AsVal_int(argv[4], &val5);
3816
+ if (!SWIG_IsOK(ecode5)) {
3817
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "CaboCha::PossetType","CaboCha::runDependencyTraining", 5, argv[4] ));
3818
+ }
3819
+ arg5 = static_cast< CaboCha::PossetType >(val5);
3820
+ ecode6 = SWIG_AsVal_double(argv[5], &val6);
3821
+ if (!SWIG_IsOK(ecode6)) {
3822
+ SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","CaboCha::runDependencyTraining", 6, argv[5] ));
3823
+ }
3824
+ arg6 = static_cast< double >(val6);
3825
+ ecode7 = SWIG_AsVal_int(argv[6], &val7);
3826
+ if (!SWIG_IsOK(ecode7)) {
3827
+ SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","CaboCha::runDependencyTraining", 7, argv[6] ));
3828
+ }
3829
+ arg7 = static_cast< int >(val7);
3830
+ {
3831
+ try {
3832
+ result = (bool)CaboCha::runDependencyTraining((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
3833
+ }
3834
+ catch (char *e) {
3835
+ SWIG_exception (SWIG_RuntimeError, e);
3836
+ }
3837
+ catch (const char *e) {
3838
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3839
+ }
3840
+ }
3841
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3842
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3843
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3844
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
3845
+ return vresult;
3846
+ fail:
3847
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3848
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3849
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
3850
+ return Qnil;
3851
+ }
3852
+
3853
+
3854
+ SWIGINTERN VALUE
3855
+ _wrap_runChunkingTraining(int argc, VALUE *argv, VALUE self) {
3856
+ char *arg1 = (char *) 0 ;
3857
+ char *arg2 = (char *) 0 ;
3858
+ char *arg3 = (char *) 0 ;
3859
+ CaboCha::CharsetType arg4 ;
3860
+ CaboCha::PossetType arg5 ;
3861
+ double arg6 ;
3862
+ int arg7 ;
3863
+ int res1 ;
3864
+ char *buf1 = 0 ;
3865
+ int alloc1 = 0 ;
3866
+ int res2 ;
3867
+ char *buf2 = 0 ;
3868
+ int alloc2 = 0 ;
3869
+ int res3 ;
3870
+ char *buf3 = 0 ;
3871
+ int alloc3 = 0 ;
3872
+ int val4 ;
3873
+ int ecode4 = 0 ;
3874
+ int val5 ;
3875
+ int ecode5 = 0 ;
3876
+ double val6 ;
3877
+ int ecode6 = 0 ;
3878
+ int val7 ;
3879
+ int ecode7 = 0 ;
3880
+ bool result;
3881
+ VALUE vresult = Qnil;
3882
+
3883
+ if ((argc < 7) || (argc > 7)) {
3884
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail;
3885
+ }
3886
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
3887
+ if (!SWIG_IsOK(res1)) {
3888
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","CaboCha::runChunkingTraining", 1, argv[0] ));
3889
+ }
3890
+ arg1 = reinterpret_cast< char * >(buf1);
3891
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
3892
+ if (!SWIG_IsOK(res2)) {
3893
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","CaboCha::runChunkingTraining", 2, argv[1] ));
3894
+ }
3895
+ arg2 = reinterpret_cast< char * >(buf2);
3896
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
3897
+ if (!SWIG_IsOK(res3)) {
3898
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","CaboCha::runChunkingTraining", 3, argv[2] ));
3899
+ }
3900
+ arg3 = reinterpret_cast< char * >(buf3);
3901
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
3902
+ if (!SWIG_IsOK(ecode4)) {
3903
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "CaboCha::CharsetType","CaboCha::runChunkingTraining", 4, argv[3] ));
3904
+ }
3905
+ arg4 = static_cast< CaboCha::CharsetType >(val4);
3906
+ ecode5 = SWIG_AsVal_int(argv[4], &val5);
3907
+ if (!SWIG_IsOK(ecode5)) {
3908
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "CaboCha::PossetType","CaboCha::runChunkingTraining", 5, argv[4] ));
3909
+ }
3910
+ arg5 = static_cast< CaboCha::PossetType >(val5);
3911
+ ecode6 = SWIG_AsVal_double(argv[5], &val6);
3912
+ if (!SWIG_IsOK(ecode6)) {
3913
+ SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","CaboCha::runChunkingTraining", 6, argv[5] ));
3914
+ }
3915
+ arg6 = static_cast< double >(val6);
3916
+ ecode7 = SWIG_AsVal_int(argv[6], &val7);
3917
+ if (!SWIG_IsOK(ecode7)) {
3918
+ SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","CaboCha::runChunkingTraining", 7, argv[6] ));
3919
+ }
3920
+ arg7 = static_cast< int >(val7);
3921
+ {
3922
+ try {
3923
+ result = (bool)CaboCha::runChunkingTraining((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
3924
+ }
3925
+ catch (char *e) {
3926
+ SWIG_exception (SWIG_RuntimeError, e);
3927
+ }
3928
+ catch (const char *e) {
3929
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
3930
+ }
3931
+ }
3932
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3933
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3934
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3935
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
3936
+ return vresult;
3937
+ fail:
3938
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3939
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
3940
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
3941
+ return Qnil;
3942
+ }
3943
+
3944
+
3945
+ SWIGINTERN VALUE
3946
+ _wrap_runNETraining(int argc, VALUE *argv, VALUE self) {
3947
+ char *arg1 = (char *) 0 ;
3948
+ char *arg2 = (char *) 0 ;
3949
+ char *arg3 = (char *) 0 ;
3950
+ CaboCha::CharsetType arg4 ;
3951
+ CaboCha::PossetType arg5 ;
3952
+ double arg6 ;
3953
+ int arg7 ;
3954
+ int res1 ;
3955
+ char *buf1 = 0 ;
3956
+ int alloc1 = 0 ;
3957
+ int res2 ;
3958
+ char *buf2 = 0 ;
3959
+ int alloc2 = 0 ;
3960
+ int res3 ;
3961
+ char *buf3 = 0 ;
3962
+ int alloc3 = 0 ;
3963
+ int val4 ;
3964
+ int ecode4 = 0 ;
3965
+ int val5 ;
3966
+ int ecode5 = 0 ;
3967
+ double val6 ;
3968
+ int ecode6 = 0 ;
3969
+ int val7 ;
3970
+ int ecode7 = 0 ;
3971
+ bool result;
3972
+ VALUE vresult = Qnil;
3973
+
3974
+ if ((argc < 7) || (argc > 7)) {
3975
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail;
3976
+ }
3977
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
3978
+ if (!SWIG_IsOK(res1)) {
3979
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","CaboCha::runNETraining", 1, argv[0] ));
3980
+ }
3981
+ arg1 = reinterpret_cast< char * >(buf1);
3982
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
3983
+ if (!SWIG_IsOK(res2)) {
3984
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","CaboCha::runNETraining", 2, argv[1] ));
3985
+ }
3986
+ arg2 = reinterpret_cast< char * >(buf2);
3987
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
3988
+ if (!SWIG_IsOK(res3)) {
3989
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","CaboCha::runNETraining", 3, argv[2] ));
3990
+ }
3991
+ arg3 = reinterpret_cast< char * >(buf3);
3992
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
3993
+ if (!SWIG_IsOK(ecode4)) {
3994
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "CaboCha::CharsetType","CaboCha::runNETraining", 4, argv[3] ));
3995
+ }
3996
+ arg4 = static_cast< CaboCha::CharsetType >(val4);
3997
+ ecode5 = SWIG_AsVal_int(argv[4], &val5);
3998
+ if (!SWIG_IsOK(ecode5)) {
3999
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "CaboCha::PossetType","CaboCha::runNETraining", 5, argv[4] ));
4000
+ }
4001
+ arg5 = static_cast< CaboCha::PossetType >(val5);
4002
+ ecode6 = SWIG_AsVal_double(argv[5], &val6);
4003
+ if (!SWIG_IsOK(ecode6)) {
4004
+ SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","CaboCha::runNETraining", 6, argv[5] ));
4005
+ }
4006
+ arg6 = static_cast< double >(val6);
4007
+ ecode7 = SWIG_AsVal_int(argv[6], &val7);
4008
+ if (!SWIG_IsOK(ecode7)) {
4009
+ SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","CaboCha::runNETraining", 7, argv[6] ));
4010
+ }
4011
+ arg7 = static_cast< int >(val7);
4012
+ {
4013
+ try {
4014
+ result = (bool)CaboCha::runNETraining((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
4015
+ }
4016
+ catch (char *e) {
4017
+ SWIG_exception (SWIG_RuntimeError, e);
4018
+ }
4019
+ catch (const char *e) {
4020
+ SWIG_exception (SWIG_RuntimeError, (char*)e);
4021
+ }
4022
+ }
4023
+ vresult = SWIG_From_bool(static_cast< bool >(result));
4024
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4025
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4026
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
4027
+ return vresult;
4028
+ fail:
4029
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
4030
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
4031
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
4032
+ return Qnil;
4033
+ }
4034
+
4035
+
4036
+
4037
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4038
+
4039
+ static swig_type_info _swigt__p_CaboCha__Parser = {"_p_CaboCha__Parser", "CaboCha::Parser *", 0, 0, (void*)0, 0};
4040
+ static swig_type_info _swigt__p_CaboCha__Tree = {"_p_CaboCha__Tree", "CaboCha::Tree *", 0, 0, (void*)0, 0};
4041
+ static swig_type_info _swigt__p_cabocha_chunk_t = {"_p_cabocha_chunk_t", "cabocha_chunk_t *|CaboCha::Chunk *", 0, 0, (void*)0, 0};
4042
+ static swig_type_info _swigt__p_cabocha_t = {"_p_cabocha_t", "cabocha_t *", 0, 0, (void*)0, 0};
4043
+ static swig_type_info _swigt__p_cabocha_token_t = {"_p_cabocha_token_t", "cabocha_token_t *|CaboCha::Token *", 0, 0, (void*)0, 0};
4044
+ static swig_type_info _swigt__p_cabocha_tree_t = {"_p_cabocha_tree_t", "cabocha_tree_t *", 0, 0, (void*)0, 0};
4045
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4046
+ static swig_type_info _swigt__p_mecab_node_t = {"_p_mecab_node_t", "mecab_node_t *", 0, 0, (void*)0, 0};
4047
+
4048
+ static swig_type_info *swig_type_initial[] = {
4049
+ &_swigt__p_CaboCha__Parser,
4050
+ &_swigt__p_CaboCha__Tree,
4051
+ &_swigt__p_cabocha_chunk_t,
4052
+ &_swigt__p_cabocha_t,
4053
+ &_swigt__p_cabocha_token_t,
4054
+ &_swigt__p_cabocha_tree_t,
4055
+ &_swigt__p_char,
4056
+ &_swigt__p_mecab_node_t,
4057
+ };
4058
+
4059
+ static swig_cast_info _swigc__p_CaboCha__Parser[] = { {&_swigt__p_CaboCha__Parser, 0, 0, 0},{0, 0, 0, 0}};
4060
+ static swig_cast_info _swigc__p_CaboCha__Tree[] = { {&_swigt__p_CaboCha__Tree, 0, 0, 0},{0, 0, 0, 0}};
4061
+ static swig_cast_info _swigc__p_cabocha_chunk_t[] = { {&_swigt__p_cabocha_chunk_t, 0, 0, 0},{0, 0, 0, 0}};
4062
+ static swig_cast_info _swigc__p_cabocha_t[] = { {&_swigt__p_cabocha_t, 0, 0, 0},{0, 0, 0, 0}};
4063
+ static swig_cast_info _swigc__p_cabocha_token_t[] = { {&_swigt__p_cabocha_token_t, 0, 0, 0},{0, 0, 0, 0}};
4064
+ static swig_cast_info _swigc__p_cabocha_tree_t[] = { {&_swigt__p_cabocha_tree_t, 0, 0, 0},{0, 0, 0, 0}};
4065
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4066
+ static swig_cast_info _swigc__p_mecab_node_t[] = { {&_swigt__p_mecab_node_t, 0, 0, 0},{0, 0, 0, 0}};
4067
+
4068
+ static swig_cast_info *swig_cast_initial[] = {
4069
+ _swigc__p_CaboCha__Parser,
4070
+ _swigc__p_CaboCha__Tree,
4071
+ _swigc__p_cabocha_chunk_t,
4072
+ _swigc__p_cabocha_t,
4073
+ _swigc__p_cabocha_token_t,
4074
+ _swigc__p_cabocha_tree_t,
4075
+ _swigc__p_char,
4076
+ _swigc__p_mecab_node_t,
4077
+ };
4078
+
4079
+
4080
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4081
+
4082
+ /* -----------------------------------------------------------------------------
4083
+ * Type initialization:
4084
+ * This problem is tough by the requirement that no dynamic
4085
+ * memory is used. Also, since swig_type_info structures store pointers to
4086
+ * swig_cast_info structures and swig_cast_info structures store pointers back
4087
+ * to swig_type_info structures, we need some lookup code at initialization.
4088
+ * The idea is that swig generates all the structures that are needed.
4089
+ * The runtime then collects these partially filled structures.
4090
+ * The SWIG_InitializeModule function takes these initial arrays out of
4091
+ * swig_module, and does all the lookup, filling in the swig_module.types
4092
+ * array with the correct data and linking the correct swig_cast_info
4093
+ * structures together.
4094
+ *
4095
+ * The generated swig_type_info structures are assigned staticly to an initial
4096
+ * array. We just loop through that array, and handle each type individually.
4097
+ * First we lookup if this type has been already loaded, and if so, use the
4098
+ * loaded structure instead of the generated one. Then we have to fill in the
4099
+ * cast linked list. The cast data is initially stored in something like a
4100
+ * two-dimensional array. Each row corresponds to a type (there are the same
4101
+ * number of rows as there are in the swig_type_initial array). Each entry in
4102
+ * a column is one of the swig_cast_info structures for that type.
4103
+ * The cast_initial array is actually an array of arrays, because each row has
4104
+ * a variable number of columns. So to actually build the cast linked list,
4105
+ * we find the array of casts associated with the type, and loop through it
4106
+ * adding the casts to the list. The one last trick we need to do is making
4107
+ * sure the type pointer in the swig_cast_info struct is correct.
4108
+ *
4109
+ * First off, we lookup the cast->type name to see if it is already loaded.
4110
+ * There are three cases to handle:
4111
+ * 1) If the cast->type has already been loaded AND the type we are adding
4112
+ * casting info to has not been loaded (it is in this module), THEN we
4113
+ * replace the cast->type pointer with the type pointer that has already
4114
+ * been loaded.
4115
+ * 2) If BOTH types (the one we are adding casting info to, and the
4116
+ * cast->type) are loaded, THEN the cast info has already been loaded by
4117
+ * the previous module so we just ignore it.
4118
+ * 3) Finally, if cast->type has not already been loaded, then we add that
4119
+ * swig_cast_info to the linked list (because the cast->type) pointer will
4120
+ * be correct.
4121
+ * ----------------------------------------------------------------------------- */
4122
+
4123
+ #ifdef __cplusplus
4124
+ extern "C" {
4125
+ #if 0
4126
+ } /* c-mode */
4127
+ #endif
4128
+ #endif
4129
+
4130
+ #if 0
4131
+ #define SWIGRUNTIME_DEBUG
4132
+ #endif
4133
+
4134
+
4135
+ SWIGRUNTIME void
4136
+ SWIG_InitializeModule(void *clientdata) {
4137
+ size_t i;
4138
+ swig_module_info *module_head, *iter;
4139
+ int found, init;
4140
+
4141
+ /* check to see if the circular list has been setup, if not, set it up */
4142
+ if (swig_module.next==0) {
4143
+ /* Initialize the swig_module */
4144
+ swig_module.type_initial = swig_type_initial;
4145
+ swig_module.cast_initial = swig_cast_initial;
4146
+ swig_module.next = &swig_module;
4147
+ init = 1;
4148
+ } else {
4149
+ init = 0;
4150
+ }
4151
+
4152
+ /* Try and load any already created modules */
4153
+ module_head = SWIG_GetModule(clientdata);
4154
+ if (!module_head) {
4155
+ /* This is the first module loaded for this interpreter */
4156
+ /* so set the swig module into the interpreter */
4157
+ SWIG_SetModule(clientdata, &swig_module);
4158
+ module_head = &swig_module;
4159
+ } else {
4160
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4161
+ found=0;
4162
+ iter=module_head;
4163
+ do {
4164
+ if (iter==&swig_module) {
4165
+ found=1;
4166
+ break;
4167
+ }
4168
+ iter=iter->next;
4169
+ } while (iter!= module_head);
4170
+
4171
+ /* if the is found in the list, then all is done and we may leave */
4172
+ if (found) return;
4173
+ /* otherwise we must add out module into the list */
4174
+ swig_module.next = module_head->next;
4175
+ module_head->next = &swig_module;
4176
+ }
4177
+
4178
+ /* When multiple interpreters are used, a module could have already been initialized in
4179
+ a different interpreter, but not yet have a pointer in this interpreter.
4180
+ In this case, we do not want to continue adding types... everything should be
4181
+ set up already */
4182
+ if (init == 0) return;
4183
+
4184
+ /* Now work on filling in swig_module.types */
4185
+ #ifdef SWIGRUNTIME_DEBUG
4186
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4187
+ #endif
4188
+ for (i = 0; i < swig_module.size; ++i) {
4189
+ swig_type_info *type = 0;
4190
+ swig_type_info *ret;
4191
+ swig_cast_info *cast;
4192
+
4193
+ #ifdef SWIGRUNTIME_DEBUG
4194
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4195
+ #endif
4196
+
4197
+ /* if there is another module already loaded */
4198
+ if (swig_module.next != &swig_module) {
4199
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4200
+ }
4201
+ if (type) {
4202
+ /* Overwrite clientdata field */
4203
+ #ifdef SWIGRUNTIME_DEBUG
4204
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
4205
+ #endif
4206
+ if (swig_module.type_initial[i]->clientdata) {
4207
+ type->clientdata = swig_module.type_initial[i]->clientdata;
4208
+ #ifdef SWIGRUNTIME_DEBUG
4209
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4210
+ #endif
4211
+ }
4212
+ } else {
4213
+ type = swig_module.type_initial[i];
4214
+ }
4215
+
4216
+ /* Insert casting types */
4217
+ cast = swig_module.cast_initial[i];
4218
+ while (cast->type) {
4219
+
4220
+ /* Don't need to add information already in the list */
4221
+ ret = 0;
4222
+ #ifdef SWIGRUNTIME_DEBUG
4223
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4224
+ #endif
4225
+ if (swig_module.next != &swig_module) {
4226
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4227
+ #ifdef SWIGRUNTIME_DEBUG
4228
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4229
+ #endif
4230
+ }
4231
+ if (ret) {
4232
+ if (type == swig_module.type_initial[i]) {
4233
+ #ifdef SWIGRUNTIME_DEBUG
4234
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4235
+ #endif
4236
+ cast->type = ret;
4237
+ ret = 0;
4238
+ } else {
4239
+ /* Check for casting already in the list */
4240
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4241
+ #ifdef SWIGRUNTIME_DEBUG
4242
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4243
+ #endif
4244
+ if (!ocast) ret = 0;
4245
+ }
4246
+ }
4247
+
4248
+ if (!ret) {
4249
+ #ifdef SWIGRUNTIME_DEBUG
4250
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4251
+ #endif
4252
+ if (type->cast) {
4253
+ type->cast->prev = cast;
4254
+ cast->next = type->cast;
4255
+ }
4256
+ type->cast = cast;
4257
+ }
4258
+ cast++;
4259
+ }
4260
+ /* Set entry in modules->types array equal to the type */
4261
+ swig_module.types[i] = type;
4262
+ }
4263
+ swig_module.types[i] = 0;
4264
+
4265
+ #ifdef SWIGRUNTIME_DEBUG
4266
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4267
+ for (i = 0; i < swig_module.size; ++i) {
4268
+ int j = 0;
4269
+ swig_cast_info *cast = swig_module.cast_initial[i];
4270
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4271
+ while (cast->type) {
4272
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4273
+ cast++;
4274
+ ++j;
4275
+ }
4276
+ printf("---- Total casts: %d\n",j);
4277
+ }
4278
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4279
+ #endif
4280
+ }
4281
+
4282
+ /* This function will propagate the clientdata field of type to
4283
+ * any new swig_type_info structures that have been added into the list
4284
+ * of equivalent types. It is like calling
4285
+ * SWIG_TypeClientData(type, clientdata) a second time.
4286
+ */
4287
+ SWIGRUNTIME void
4288
+ SWIG_PropagateClientData(void) {
4289
+ size_t i;
4290
+ swig_cast_info *equiv;
4291
+ static int init_run = 0;
4292
+
4293
+ if (init_run) return;
4294
+ init_run = 1;
4295
+
4296
+ for (i = 0; i < swig_module.size; i++) {
4297
+ if (swig_module.types[i]->clientdata) {
4298
+ equiv = swig_module.types[i]->cast;
4299
+ while (equiv) {
4300
+ if (!equiv->converter) {
4301
+ if (equiv->type && !equiv->type->clientdata)
4302
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4303
+ }
4304
+ equiv = equiv->next;
4305
+ }
4306
+ }
4307
+ }
4308
+ }
4309
+
4310
+ #ifdef __cplusplus
4311
+ #if 0
4312
+ { /* c-mode */
4313
+ #endif
4314
+ }
4315
+ #endif
4316
+
4317
+ /*
4318
+
4319
+ */
4320
+ #ifdef __cplusplus
4321
+ extern "C"
4322
+ #endif
4323
+ SWIGEXPORT void Init_CaboCha(void) {
4324
+ size_t i;
4325
+
4326
+ SWIG_InitRuntime();
4327
+ mCaboCha = rb_define_module("CaboCha");
4328
+
4329
+ SWIG_InitializeModule(0);
4330
+ for (i = 0; i < swig_module.size; i++) {
4331
+ SWIG_define_class(swig_module.types[i]);
4332
+ }
4333
+
4334
+ SWIG_RubyInitializeTrackings();
4335
+ rb_define_const(mCaboCha, "CABOCHA_EUC_JP", SWIG_From_int(static_cast< int >(CABOCHA_EUC_JP)));
4336
+ rb_define_const(mCaboCha, "CABOCHA_CP932", SWIG_From_int(static_cast< int >(CABOCHA_CP932)));
4337
+ rb_define_const(mCaboCha, "CABOCHA_UTF8", SWIG_From_int(static_cast< int >(CABOCHA_UTF8)));
4338
+ rb_define_const(mCaboCha, "CABOCHA_ASCII", SWIG_From_int(static_cast< int >(CABOCHA_ASCII)));
4339
+ rb_define_const(mCaboCha, "CABOCHA_IPA", SWIG_From_int(static_cast< int >(CABOCHA_IPA)));
4340
+ rb_define_const(mCaboCha, "CABOCHA_JUMAN", SWIG_From_int(static_cast< int >(CABOCHA_JUMAN)));
4341
+ rb_define_const(mCaboCha, "CABOCHA_UNIDIC", SWIG_From_int(static_cast< int >(CABOCHA_UNIDIC)));
4342
+ rb_define_const(mCaboCha, "CABOCHA_FORMAT_TREE", SWIG_From_int(static_cast< int >(CABOCHA_FORMAT_TREE)));
4343
+ rb_define_const(mCaboCha, "CABOCHA_FORMAT_LATTICE", SWIG_From_int(static_cast< int >(CABOCHA_FORMAT_LATTICE)));
4344
+ rb_define_const(mCaboCha, "CABOCHA_FORMAT_TREE_LATTICE", SWIG_From_int(static_cast< int >(CABOCHA_FORMAT_TREE_LATTICE)));
4345
+ rb_define_const(mCaboCha, "CABOCHA_FORMAT_XML", SWIG_From_int(static_cast< int >(CABOCHA_FORMAT_XML)));
4346
+ rb_define_const(mCaboCha, "CABOCHA_FORMAT_CONLL", SWIG_From_int(static_cast< int >(CABOCHA_FORMAT_CONLL)));
4347
+ rb_define_const(mCaboCha, "CABOCHA_FORMAT_NONE", SWIG_From_int(static_cast< int >(CABOCHA_FORMAT_NONE)));
4348
+ rb_define_const(mCaboCha, "CABOCHA_INPUT_RAW_SENTENCE", SWIG_From_int(static_cast< int >(CABOCHA_INPUT_RAW_SENTENCE)));
4349
+ rb_define_const(mCaboCha, "CABOCHA_INPUT_POS", SWIG_From_int(static_cast< int >(CABOCHA_INPUT_POS)));
4350
+ rb_define_const(mCaboCha, "CABOCHA_INPUT_CHUNK", SWIG_From_int(static_cast< int >(CABOCHA_INPUT_CHUNK)));
4351
+ rb_define_const(mCaboCha, "CABOCHA_INPUT_SELECTION", SWIG_From_int(static_cast< int >(CABOCHA_INPUT_SELECTION)));
4352
+ rb_define_const(mCaboCha, "CABOCHA_INPUT_DEP", SWIG_From_int(static_cast< int >(CABOCHA_INPUT_DEP)));
4353
+ rb_define_const(mCaboCha, "CABOCHA_OUTPUT_RAW_SENTENCE", SWIG_From_int(static_cast< int >(CABOCHA_OUTPUT_RAW_SENTENCE)));
4354
+ rb_define_const(mCaboCha, "CABOCHA_OUTPUT_POS", SWIG_From_int(static_cast< int >(CABOCHA_OUTPUT_POS)));
4355
+ rb_define_const(mCaboCha, "CABOCHA_OUTPUT_CHUNK", SWIG_From_int(static_cast< int >(CABOCHA_OUTPUT_CHUNK)));
4356
+ rb_define_const(mCaboCha, "CABOCHA_OUTPUT_SELECTION", SWIG_From_int(static_cast< int >(CABOCHA_OUTPUT_SELECTION)));
4357
+ rb_define_const(mCaboCha, "CABOCHA_OUTPUT_DEP", SWIG_From_int(static_cast< int >(CABOCHA_OUTPUT_DEP)));
4358
+ rb_define_const(mCaboCha, "CABOCHA_TRAIN_NE", SWIG_From_int(static_cast< int >(CABOCHA_TRAIN_NE)));
4359
+ rb_define_const(mCaboCha, "CABOCHA_TRAIN_CHUNK", SWIG_From_int(static_cast< int >(CABOCHA_TRAIN_CHUNK)));
4360
+ rb_define_const(mCaboCha, "CABOCHA_TRAIN_DEP", SWIG_From_int(static_cast< int >(CABOCHA_TRAIN_DEP)));
4361
+
4362
+ SwigClassChunk.klass = rb_define_class_under(mCaboCha, "Chunk", rb_cObject);
4363
+ SWIG_TypeClientData(SWIGTYPE_p_cabocha_chunk_t, (void *) &SwigClassChunk);
4364
+ rb_undef_alloc_func(SwigClassChunk.klass);
4365
+ rb_define_method(SwigClassChunk.klass, "link", VALUEFUNC(_wrap_Chunk_link_get), -1);
4366
+ rb_define_method(SwigClassChunk.klass, "head_pos", VALUEFUNC(_wrap_Chunk_head_pos_get), -1);
4367
+ rb_define_method(SwigClassChunk.klass, "func_pos", VALUEFUNC(_wrap_Chunk_func_pos_get), -1);
4368
+ rb_define_method(SwigClassChunk.klass, "token_size", VALUEFUNC(_wrap_Chunk_token_size_get), -1);
4369
+ rb_define_method(SwigClassChunk.klass, "token_pos", VALUEFUNC(_wrap_Chunk_token_pos_get), -1);
4370
+ rb_define_method(SwigClassChunk.klass, "score", VALUEFUNC(_wrap_Chunk_score_get), -1);
4371
+ rb_define_method(SwigClassChunk.klass, "additional_info", VALUEFUNC(_wrap_Chunk_additional_info_get), -1);
4372
+ rb_define_method(SwigClassChunk.klass, "feature_list_size", VALUEFUNC(_wrap_Chunk_feature_list_size_get), -1);
4373
+ rb_define_method(SwigClassChunk.klass, "feature_list", VALUEFUNC(_wrap_Chunk_feature_list), -1);
4374
+ SwigClassChunk.mark = 0;
4375
+ SwigClassChunk.trackObjects = 0;
4376
+
4377
+ SwigClassToken.klass = rb_define_class_under(mCaboCha, "Token", rb_cObject);
4378
+ SWIG_TypeClientData(SWIGTYPE_p_cabocha_token_t, (void *) &SwigClassToken);
4379
+ rb_undef_alloc_func(SwigClassToken.klass);
4380
+ rb_define_method(SwigClassToken.klass, "surface", VALUEFUNC(_wrap_Token_surface_get), -1);
4381
+ rb_define_method(SwigClassToken.klass, "normalized_surface", VALUEFUNC(_wrap_Token_normalized_surface_get), -1);
4382
+ rb_define_method(SwigClassToken.klass, "feature", VALUEFUNC(_wrap_Token_feature_get), -1);
4383
+ rb_define_method(SwigClassToken.klass, "feature_list_size", VALUEFUNC(_wrap_Token_feature_list_size_get), -1);
4384
+ rb_define_method(SwigClassToken.klass, "ne", VALUEFUNC(_wrap_Token_ne_get), -1);
4385
+ rb_define_method(SwigClassToken.klass, "additional_info", VALUEFUNC(_wrap_Token_additional_info_get), -1);
4386
+ rb_define_method(SwigClassToken.klass, "chunk", VALUEFUNC(_wrap_Token_chunk_get), -1);
4387
+ rb_define_method(SwigClassToken.klass, "feature_list", VALUEFUNC(_wrap_Token_feature_list), -1);
4388
+ SwigClassToken.mark = 0;
4389
+ SwigClassToken.trackObjects = 0;
4390
+ rb_define_const(mCaboCha, "EUC_JP", SWIG_From_int(static_cast< int >(CaboCha::EUC_JP)));
4391
+ rb_define_const(mCaboCha, "CP932", SWIG_From_int(static_cast< int >(CaboCha::CP932)));
4392
+ rb_define_const(mCaboCha, "UTF8", SWIG_From_int(static_cast< int >(CaboCha::UTF8)));
4393
+ rb_define_const(mCaboCha, "ASCII", SWIG_From_int(static_cast< int >(CaboCha::ASCII)));
4394
+ rb_define_const(mCaboCha, "IPA", SWIG_From_int(static_cast< int >(CaboCha::IPA)));
4395
+ rb_define_const(mCaboCha, "JUMAN", SWIG_From_int(static_cast< int >(CaboCha::JUMAN)));
4396
+ rb_define_const(mCaboCha, "UNIDIC", SWIG_From_int(static_cast< int >(CaboCha::UNIDIC)));
4397
+ rb_define_const(mCaboCha, "FORMAT_TREE", SWIG_From_int(static_cast< int >(CaboCha::FORMAT_TREE)));
4398
+ rb_define_const(mCaboCha, "FORMAT_LATTICE", SWIG_From_int(static_cast< int >(CaboCha::FORMAT_LATTICE)));
4399
+ rb_define_const(mCaboCha, "FORMAT_TREE_LATTICE", SWIG_From_int(static_cast< int >(CaboCha::FORMAT_TREE_LATTICE)));
4400
+ rb_define_const(mCaboCha, "FORMAT_XML", SWIG_From_int(static_cast< int >(CaboCha::FORMAT_XML)));
4401
+ rb_define_const(mCaboCha, "FORMAT_CONLL", SWIG_From_int(static_cast< int >(CaboCha::FORMAT_CONLL)));
4402
+ rb_define_const(mCaboCha, "FORMAT_NONE", SWIG_From_int(static_cast< int >(CaboCha::FORMAT_NONE)));
4403
+ rb_define_const(mCaboCha, "INPUT_RAW_SENTENCE", SWIG_From_int(static_cast< int >(CaboCha::INPUT_RAW_SENTENCE)));
4404
+ rb_define_const(mCaboCha, "INPUT_POS", SWIG_From_int(static_cast< int >(CaboCha::INPUT_POS)));
4405
+ rb_define_const(mCaboCha, "INPUT_CHUNK", SWIG_From_int(static_cast< int >(CaboCha::INPUT_CHUNK)));
4406
+ rb_define_const(mCaboCha, "INPUT_SELECTION", SWIG_From_int(static_cast< int >(CaboCha::INPUT_SELECTION)));
4407
+ rb_define_const(mCaboCha, "INPUT_DEP", SWIG_From_int(static_cast< int >(CaboCha::INPUT_DEP)));
4408
+ rb_define_const(mCaboCha, "OUTPUT_RAW_SENTENCE", SWIG_From_int(static_cast< int >(CaboCha::OUTPUT_RAW_SENTENCE)));
4409
+ rb_define_const(mCaboCha, "OUTPUT_POS", SWIG_From_int(static_cast< int >(CaboCha::OUTPUT_POS)));
4410
+ rb_define_const(mCaboCha, "OUTPUT_CHUNK", SWIG_From_int(static_cast< int >(CaboCha::OUTPUT_CHUNK)));
4411
+ rb_define_const(mCaboCha, "OUTPUT_SELECTION", SWIG_From_int(static_cast< int >(CaboCha::OUTPUT_SELECTION)));
4412
+ rb_define_const(mCaboCha, "OUTPUT_DEP", SWIG_From_int(static_cast< int >(CaboCha::OUTPUT_DEP)));
4413
+ rb_define_const(mCaboCha, "TRAIN_NE", SWIG_From_int(static_cast< int >(CaboCha::TRAIN_NE)));
4414
+ rb_define_const(mCaboCha, "TRAIN_CHUNK", SWIG_From_int(static_cast< int >(CaboCha::TRAIN_CHUNK)));
4415
+ rb_define_const(mCaboCha, "TRAIN_DEP", SWIG_From_int(static_cast< int >(CaboCha::TRAIN_DEP)));
4416
+
4417
+ SwigClassTree.klass = rb_define_class_under(mCaboCha, "Tree", rb_cObject);
4418
+ SWIG_TypeClientData(SWIGTYPE_p_CaboCha__Tree, (void *) &SwigClassTree);
4419
+ rb_define_alloc_func(SwigClassTree.klass, _wrap_Tree_allocate);
4420
+ rb_define_method(SwigClassTree.klass, "initialize", VALUEFUNC(_wrap_new_Tree), -1);
4421
+ rb_define_method(SwigClassTree.klass, "set_sentence", VALUEFUNC(_wrap_Tree_set_sentence), -1);
4422
+ rb_define_method(SwigClassTree.klass, "sentence", VALUEFUNC(_wrap_Tree_sentence), -1);
4423
+ rb_define_method(SwigClassTree.klass, "sentence_size", VALUEFUNC(_wrap_Tree_sentence_size), -1);
4424
+ rb_define_method(SwigClassTree.klass, "chunk", VALUEFUNC(_wrap_Tree_chunk), -1);
4425
+ rb_define_method(SwigClassTree.klass, "token", VALUEFUNC(_wrap_Tree_token), -1);
4426
+ rb_define_method(SwigClassTree.klass, "read", VALUEFUNC(_wrap_Tree_read), -1);
4427
+ rb_define_method(SwigClassTree.klass, "empty", VALUEFUNC(_wrap_Tree_empty), -1);
4428
+ rb_define_method(SwigClassTree.klass, "clear", VALUEFUNC(_wrap_Tree_clear), -1);
4429
+ rb_define_method(SwigClassTree.klass, "clear_chunk", VALUEFUNC(_wrap_Tree_clear_chunk), -1);
4430
+ rb_define_method(SwigClassTree.klass, "chunk_size", VALUEFUNC(_wrap_Tree_chunk_size), -1);
4431
+ rb_define_method(SwigClassTree.klass, "token_size", VALUEFUNC(_wrap_Tree_token_size), -1);
4432
+ rb_define_method(SwigClassTree.klass, "size", VALUEFUNC(_wrap_Tree_size), -1);
4433
+ rb_define_method(SwigClassTree.klass, "toString", VALUEFUNC(_wrap_Tree_toString), -1);
4434
+ rb_define_method(SwigClassTree.klass, "charset", VALUEFUNC(_wrap_Tree_charset), -1);
4435
+ rb_define_method(SwigClassTree.klass, "set_charset", VALUEFUNC(_wrap_Tree_set_charset), -1);
4436
+ rb_define_method(SwigClassTree.klass, "posset", VALUEFUNC(_wrap_Tree_posset), -1);
4437
+ rb_define_method(SwigClassTree.klass, "set_posset", VALUEFUNC(_wrap_Tree_set_posset), -1);
4438
+ rb_define_method(SwigClassTree.klass, "output_layer", VALUEFUNC(_wrap_Tree_output_layer), -1);
4439
+ rb_define_method(SwigClassTree.klass, "set_output_layer", VALUEFUNC(_wrap_Tree_set_output_layer), -1);
4440
+ rb_define_method(SwigClassTree.klass, "what", VALUEFUNC(_wrap_Tree_what), -1);
4441
+ SwigClassTree.mark = 0;
4442
+ SwigClassTree.destroy = (void (*)(void *)) free_CaboCha_Tree;
4443
+ SwigClassTree.trackObjects = 0;
4444
+
4445
+ SwigClassParser.klass = rb_define_class_under(mCaboCha, "Parser", rb_cObject);
4446
+ SWIG_TypeClientData(SWIGTYPE_p_CaboCha__Parser, (void *) &SwigClassParser);
4447
+ rb_define_alloc_func(SwigClassParser.klass, _wrap_Parser_allocate);
4448
+ rb_define_method(SwigClassParser.klass, "initialize", VALUEFUNC(_wrap_new_Parser), -1);
4449
+ rb_define_method(SwigClassParser.klass, "parseToString", VALUEFUNC(_wrap_Parser_parseToString), -1);
4450
+ rb_define_method(SwigClassParser.klass, "parse", VALUEFUNC(_wrap_Parser_parse), -1);
4451
+ rb_define_method(SwigClassParser.klass, "what", VALUEFUNC(_wrap_Parser_what), -1);
4452
+ rb_define_singleton_method(SwigClassParser.klass, "version", VALUEFUNC(_wrap_Parser_version), -1);
4453
+ SwigClassParser.mark = 0;
4454
+ SwigClassParser.destroy = (void (*)(void *)) free_CaboCha_Parser;
4455
+ SwigClassParser.trackObjects = 0;
4456
+ rb_define_module_function(mCaboCha, "getLastError", VALUEFUNC(_wrap_getLastError), -1);
4457
+ rb_define_module_function(mCaboCha, "runDependencyTraining", VALUEFUNC(_wrap_runDependencyTraining), -1);
4458
+ rb_define_module_function(mCaboCha, "runChunkingTraining", VALUEFUNC(_wrap_runChunkingTraining), -1);
4459
+ rb_define_module_function(mCaboCha, "runNETraining", VALUEFUNC(_wrap_runNETraining), -1);
4460
+ rb_define_const(mCaboCha, "VERSION", SWIG_FromCharPtr("0.69"));
4461
+ }
4462
+