mecab-perl-0.996/ 0000755 0025620 0011610 00000000000 12110211100 012020 5 ustar taku eng mecab-perl-0.996/LGPL 0000644 0025620 0011610 00000063474 12110211100 012517 0 ustar taku eng GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
mecab-perl-0.996/test.pl 0000644 0025620 0011610 00000002634 12110211100 013341 0 ustar taku eng #!/usr/bin/perl
use lib "../src/.libs";
use lib $ENV{PWD} . "/blib/lib";
use lib $ENV{PWD} . "/blib/arch";
use MeCab;
print $MeCab::VERSION, "\n";
my $sentence = "太郎はこの本を二郎を見た女性に渡した。";
my $model = new MeCab::Model(join " ", @ARGV);
my $c = $model->createTagger();
print $c->parse($sentence);
for (my $m = $c->parseToNode($sentence); $m; $m = $m->{next}) {
printf("%s\t%s\n", $m->{surface}, $m->{feature});
}
my $lattice = new MeCab::Lattice();
$lattice->set_sentence($sentence);
if ($c->parse($lattice)) {
for (my $i = 0; $i < $lattice->size(); ++$i) {
for (my $b = $lattice->begin_nodes($i); $b; $b = $b->{bnext}) {
printf("B[%d] %s\t%s\n", $i, $b->{surface}, $b->{feature});
}
for (my $e = $lattice->end_nodes($i); $e; $e = $e->{enext}) {
printf("E[%d] %s\t%s\n", $i, $e->{surface}, $e->{feature});
}
}
}
$lattice->set_sentence($sentence);
$lattice->set_request_type($MeCab::MECAB_NBEST);
if ($c->parse($lattice)) {
for (my $i = 0; $i < 10; ++$i) {
$lattice->next();
print $lattice->toString();
}
}
for (my $d = $c->dictionary_info(); $d; $d = $d->{next}) {
printf("filename: %s\n", $d->{filename});
printf("charset: %s\n", $d->{charset});
printf("size: %d\n", $d->{size});
printf("type: %d\n", $d->{type});
printf("lsize: %d\n", $d->{lsize});
printf("rsize: %d\n", $d->{rsize});
printf("version: %d\n", $d->{version});
}
mecab-perl-0.996/README 0000644 0025620 0011610 00000000226 12110211100 012700 0 ustar taku eng MeCab perl module
1. Installation
% perl Makefile.PL
% make
% su
# make install
2. How to use?
See 'test.pl' as a sample program
mecab-perl-0.996/COPYING 0000644 0025620 0011610 00000000360 12110211100 013052 0 ustar taku eng MeCab is copyrighted free software by Taku Kudo and
Nippon Telegraph and Telephone Corporation, and is released under
any of the GPL (see the file GPL), the LGPL (see the file LGPL), or the
BSD License (see the file BSD).
mecab-perl-0.996/MeCab_wrap.cxx 0000644 0025620 0011610 00000641631 12110211100 014557 0 ustar taku eng /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.4
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#define SWIGPERL
#define SWIG_CASTRANK_MODE
#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template class SwigValueWrapper {
struct SwigMovePointer {
T *ptr;
SwigMovePointer(T *p) : ptr(p) { }
~SwigMovePointer() { delete ptr; }
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
} pointer;
SwigValueWrapper& operator=(const SwigValueWrapper& rhs);
SwigValueWrapper(const SwigValueWrapper& rhs);
public:
SwigValueWrapper() : pointer(0) { }
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
operator T&() const { return *pointer.ptr; }
T *operator&() { return pointer.ptr; }
};
template T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
/* -----------------------------------------------------------------------------
* swigrun.swg
*
* This file contains generic C API SWIG runtime support for pointer
* type checking.
* ----------------------------------------------------------------------------- */
/* This should only be incremented when either the layout of swig_type_info changes,
or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif
/*
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
creating a static or dynamic library from the SWIG runtime code.
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
But only do this if strictly necessary, ie, if you have problems
with your compiler or suchlike.
*/
#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif
#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif
/* Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif
/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN 0x1
#define SWIG_CAST_NEW_MEMORY 0x2
/* Flags for new pointer objects */
#define SWIG_POINTER_OWN 0x1
/*
Flags/methods for returning states.
The SWIG conversion methods, as ConvertPtr, return an integer
that tells if the conversion was successful or not. And if not,
an error code can be returned (see swigerrors.swg for the codes).
Use the following macros/flags to set or process the returning
states.
In old versions of SWIG, code such as the following was usually written:
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
// success code
} else {
//fail code
}
Now you can be more explicit:
int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
if (SWIG_IsOK(res)) {
// success code
} else {
// fail code
}
which is the same really, but now you can also do
Type *ptr;
int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
if (SWIG_IsOK(res)) {
// success code
if (SWIG_IsNewObj(res) {
...
delete *ptr;
} else {
...
}
} else {
// fail code
}
I.e., now SWIG_ConvertPtr can return new objects and you can
identify the case and take care of the deallocation. Of course that
also requires SWIG_ConvertPtr to return new result values, such as
int SWIG_ConvertPtr(obj, ptr,...) {
if () {
if () {
*ptr = ;
return SWIG_NEWOBJ;
} else {
*ptr = ;
return SWIG_OLDOBJ;
}
} else {
return SWIG_BADOBJ;
}
}
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
SWIG errors code.
Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
allows to return the 'cast rank', for example, if you have this
int food(double)
int fooi(int);
and you call
food(1) // cast rank '1' (1 -> 1.0)
fooi(1) // cast rank '0'
just use the SWIG_AddCast()/SWIG_CheckState()
*/
#define SWIG_OK (0)
#define SWIG_ERROR (-1)
#define SWIG_IsOK(r) (r >= 0)
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ (SWIG_ERROR)
#define SWIG_OLDOBJ (SWIG_OK)
#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
# ifndef SWIG_TypeRank
# define SWIG_TypeRank unsigned long
# endif
# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
# define SWIG_MAXCASTRANK (2)
# endif
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) {
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) {
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
}
#else /* no cast-rank mode */
# define SWIG_AddCast
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif
#include
#ifdef __cplusplus
extern "C" {
#endif
typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);
/* Structure to store information on one type */
typedef struct swig_type_info {
const char *name; /* mangled name of this type */
const char *str; /* human readable name of this type */
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
void *clientdata; /* language specific type data */
int owndata; /* flag if the structure owns the clientdata */
} swig_type_info;
/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
swig_type_info *type; /* pointer to type that is equivalent to this type */
swig_converter_func converter; /* function to cast the void pointers */
struct swig_cast_info *next; /* pointer to next cast in linked list */
struct swig_cast_info *prev; /* pointer to the previous cast */
} swig_cast_info;
/* Structure used to store module information
* Each module generates one structure like this, and the runtime collects
* all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
size_t size; /* Number of types in this module */
struct swig_module_info *next; /* Pointer to next element in circularly linked list */
swig_type_info **type_initial; /* Array of initially generated type structures */
swig_cast_info **cast_initial; /* Array of initially generated casting structures */
void *clientdata; /* Language specific module data */
} swig_module_info;
/*
Compare two type names skipping the space characters, therefore
"char*" == "char *" and "Class" == "Class", etc.
Return 0 when the two name types are equivalent, as in
strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
const char *f2, const char *l2) {
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
while ((*f1 == ' ') && (f1 != l1)) ++f1;
while ((*f2 == ' ') && (f2 != l2)) ++f2;
if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
}
return (int)((l1 - f1) - (l2 - f2));
}
/*
Check type equivalence in a name list like ||...
Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
int equiv = 0;
const char* te = tb + strlen(tb);
const char* ne = nb;
while (!equiv && *ne) {
for (nb = ne; *ne; ++ne) {
if (*ne == '|') break;
}
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
if (*ne) ++ne;
}
return equiv;
}
/*
Check type equivalence in a name list like ||...
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCompare(const char *nb, const char *tb) {
int equiv = 0;
const char* te = tb + strlen(tb);
const char* ne = nb;
while (!equiv && *ne) {
for (nb = ne; *ne; ++ne) {
if (*ne == '|') break;
}
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
if (*ne) ++ne;
}
return equiv;
}
/*
Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
if (ty) {
swig_cast_info *iter = ty->cast;
while (iter) {
if (strcmp(iter->type->name, c) == 0) {
if (iter == ty->cast)
return iter;
/* Move iter to the top of the linked list */
iter->prev->next = iter->next;
if (iter->next)
iter->next->prev = iter->prev;
iter->next = ty->cast;
iter->prev = 0;
if (ty->cast) ty->cast->prev = iter;
ty->cast = iter;
return iter;
}
iter = iter->next;
}
}
return 0;
}
/*
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
if (ty) {
swig_cast_info *iter = ty->cast;
while (iter) {
if (iter->type == from) {
if (iter == ty->cast)
return iter;
/* Move iter to the top of the linked list */
iter->prev->next = iter->next;
if (iter->next)
iter->next->prev = iter->prev;
iter->next = ty->cast;
iter->prev = 0;
if (ty->cast) ty->cast->prev = iter;
ty->cast = iter;
return iter;
}
iter = iter->next;
}
}
return 0;
}
/*
Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}
/*
Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
swig_type_info *lastty = ty;
if (!ty || !ty->dcast) return ty;
while (ty && (ty->dcast)) {
ty = (*ty->dcast)(ptr);
if (ty) lastty = ty;
}
return lastty;
}
/*
Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
return ty->name;
}
/*
Return the pretty name associated with this type,
that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
/* The "str" field contains the equivalent pretty names of the
type, separated by vertical-bar characters. We choose
to print the last name, as it is often (?) the most
specific. */
if (!type) return NULL;
if (type->str != NULL) {
const char *last_name = type->str;
const char *s;
for (s = type->str; *s; s++)
if (*s == '|') last_name = s+1;
return last_name;
}
else
return type->name;
}
/*
Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
swig_cast_info *cast = ti->cast;
/* if (ti->clientdata == clientdata) return; */
ti->clientdata = clientdata;
while (cast) {
if (!cast->converter) {
swig_type_info *tc = cast->type;
if (!tc->clientdata) {
SWIG_TypeClientData(tc, clientdata);
}
}
cast = cast->next;
}
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
SWIG_TypeClientData(ti, clientdata);
ti->owndata = 1;
}
/*
Search for a swig_type_info structure only by mangled name
Search is a O(log #types)
We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start,
swig_module_info *end,
const char *name) {
swig_module_info *iter = start;
do {
if (iter->size) {
register size_t l = 0;
register size_t r = iter->size - 1;
do {
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
register size_t i = (l + r) >> 1;
const char *iname = iter->types[i]->name;
if (iname) {
register int compare = strcmp(name, iname);
if (compare == 0) {
return iter->types[i];
} else if (compare < 0) {
if (i) {
r = i - 1;
} else {
break;
}
} else if (compare > 0) {
l = i + 1;
}
} else {
break; /* should never happen */
}
} while (l <= r);
}
iter = iter->next;
} while (iter != end);
return 0;
}
/*
Search for a swig_type_info structure for either a mangled name or a human readable name.
It first searches the mangled names of the types, which is a O(log #types)
If a type is not found it then searches the human readable names, which is O(#types).
We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start,
swig_module_info *end,
const char *name) {
/* STEP 1: Search the name field using binary search */
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
if (ret) {
return ret;
} else {
/* STEP 2: If the type hasn't been found, do a complete search
of the str field (the human readable name) */
swig_module_info *iter = start;
do {
register size_t i = 0;
for (; i < iter->size; ++i) {
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
return iter->types[i];
}
iter = iter->next;
} while (iter != end);
}
/* neither found a match */
return 0;
}
/*
Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
static const char hex[17] = "0123456789abcdef";
register const unsigned char *u = (unsigned char *) ptr;
register const unsigned char *eu = u + sz;
for (; u != eu; ++u) {
register unsigned char uu = *u;
*(c++) = hex[(uu & 0xf0) >> 4];
*(c++) = hex[uu & 0xf];
}
return c;
}
/*
Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
register unsigned char *u = (unsigned char *) ptr;
register const unsigned char *eu = u + sz;
for (; u != eu; ++u) {
register char d = *(c++);
register unsigned char uu;
if ((d >= '0') && (d <= '9'))
uu = ((d - '0') << 4);
else if ((d >= 'a') && (d <= 'f'))
uu = ((d - ('a'-10)) << 4);
else
return (char *) 0;
d = *(c++);
if ((d >= '0') && (d <= '9'))
uu |= (d - '0');
else if ((d >= 'a') && (d <= 'f'))
uu |= (d - ('a'-10));
else
return (char *) 0;
*u = uu;
}
return c;
}
/*
Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
char *r = buff;
if ((2*sizeof(void *) + 2) > bsz) return 0;
*(r++) = '_';
r = SWIG_PackData(r,&ptr,sizeof(void *));
if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
strcpy(r,name);
return buff;
}
SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
if (*c != '_') {
if (strcmp(c,"NULL") == 0) {
*ptr = (void *) 0;
return name;
} else {
return 0;
}
}
return SWIG_UnpackData(++c,ptr,sizeof(void *));
}
SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
char *r = buff;
size_t lname = (name ? strlen(name) : 0);
if ((2*sz + 2 + lname) > bsz) return 0;
*(r++) = '_';
r = SWIG_PackData(r,ptr,sz);
if (lname) {
strncpy(r,name,lname+1);
} else {
*r = 0;
}
return buff;
}
SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
if (*c != '_') {
if (strcmp(c,"NULL") == 0) {
memset(ptr,0,sz);
return name;
} else {
return 0;
}
}
return SWIG_UnpackData(++c,ptr,sz);
}
#ifdef __cplusplus
}
#endif
/* Errors in SWIG */
#define SWIG_UnknownError -1
#define SWIG_IOError -2
#define SWIG_RuntimeError -3
#define SWIG_IndexError -4
#define SWIG_TypeError -5
#define SWIG_DivisionByZero -6
#define SWIG_OverflowError -7
#define SWIG_SyntaxError -8
#define SWIG_ValueError -9
#define SWIG_SystemError -10
#define SWIG_AttributeError -11
#define SWIG_MemoryError -12
#define SWIG_NullReferenceError -13
#ifdef __cplusplus
/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
#include
#include
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
#ifndef PERL_REVISION
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
# define PERL_PATCHLEVEL_H_IMPLICIT
# include
# endif
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
# include
# endif
# ifndef PERL_REVISION
# define PERL_REVISION (5)
# define PERL_VERSION PATCHLEVEL
# define PERL_SUBVERSION SUBVERSION
# endif
#endif
#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
#endif
#ifndef SvIOK_UV
# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
#endif
#ifndef SvUOK
# define SvUOK(sv) SvIOK_UV(sv)
#endif
#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
# define PL_sv_undef sv_undef
# define PL_na na
# define PL_errgv errgv
# define PL_sv_no sv_no
# define PL_sv_yes sv_yes
# define PL_markstack_ptr markstack_ptr
#endif
#ifndef IVSIZE
# ifdef LONGSIZE
# define IVSIZE LONGSIZE
# else
# define IVSIZE 4 /* A bold guess, but the best we can make. */
# endif
#endif
#ifndef INT2PTR
# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
# define PTRV UV
# define INT2PTR(any,d) (any)(d)
# else
# if PTRSIZE == LONGSIZE
# define PTRV unsigned long
# else
# define PTRV unsigned
# endif
# define INT2PTR(any,d) (any)(PTRV)(d)
# endif
# define NUM2PTR(any,d) (any)(PTRV)(d)
# define PTR2IV(p) INT2PTR(IV,p)
# define PTR2UV(p) INT2PTR(UV,p)
# define PTR2NV(p) NUM2PTR(NV,p)
# if PTRSIZE == LONGSIZE
# define PTR2ul(p) (unsigned long)(p)
# else
# define PTR2ul(p) INT2PTR(unsigned long,p)
# endif
#endif /* !INT2PTR */
#ifndef SvPV_nolen
# define SvPV_nolen(x) SvPV(x,PL_na)
#endif
#ifndef get_sv
# define get_sv perl_get_sv
#endif
#ifndef ERRSV
# define ERRSV get_sv("@",FALSE)
#endif
#ifndef pTHX_
#define pTHX_
#endif
#include
#ifdef __cplusplus
}
#endif
/* -----------------------------------------------------------------------------
* error manipulation
* ----------------------------------------------------------------------------- */
SWIGINTERN const char*
SWIG_Perl_ErrorType(int code) {
const char* type = 0;
switch(code) {
case SWIG_MemoryError:
type = "MemoryError";
break;
case SWIG_IOError:
type = "IOError";
break;
case SWIG_RuntimeError:
type = "RuntimeError";
break;
case SWIG_IndexError:
type = "IndexError";
break;
case SWIG_TypeError:
type = "TypeError";
break;
case SWIG_DivisionByZero:
type = "ZeroDivisionError";
break;
case SWIG_OverflowError:
type = "OverflowError";
break;
case SWIG_SyntaxError:
type = "SyntaxError";
break;
case SWIG_ValueError:
type = "ValueError";
break;
case SWIG_SystemError:
type = "SystemError";
break;
case SWIG_AttributeError:
type = "AttributeError";
break;
default:
type = "RuntimeError";
}
return type;
}
/* -----------------------------------------------------------------------------
* perlrun.swg
*
* This file contains the runtime support for Perl modules
* and includes code for managing global variables and pointer
* type checking.
* ----------------------------------------------------------------------------- */
#ifdef PERL_OBJECT
#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
#define SWIG_PERL_OBJECT_CALL pPerl,
#else
#define SWIG_PERL_OBJECT_DECL
#define SWIG_PERL_OBJECT_CALL
#endif
/* Common SWIG API */
/* for raw pointers */
#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
/* for raw packed data */
#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
/* for class or struct pointers */
#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
/* for C or C++ function pointers */
#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type)
/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule()
#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
/* Error manipulation */
#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
#define SWIG_fail goto fail
/* Perl-specific SWIG API */
#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str)
#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1)
#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1)
#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2)
#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2)
/* -----------------------------------------------------------------------------
* pointers/data manipulation
* ----------------------------------------------------------------------------- */
/* For backward compatibility only */
#define SWIG_POINTER_EXCEPTION 0
#ifdef __cplusplus
extern "C" {
#endif
#define SWIG_OWNER SWIG_POINTER_OWN
#define SWIG_SHADOW SWIG_OWNER << 1
#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
/* SWIG Perl macros */
/* Macro to declare an XS function */
#ifndef XSPROTO
# define XSPROTO(name) void name(pTHX_ CV* cv)
#endif
/* Macro to call an XS function */
#ifdef PERL_OBJECT
# define SWIG_CALLXS(_name) _name(cv,pPerl)
#else
# ifndef MULTIPLICITY
# define SWIG_CALLXS(_name) _name(cv)
# else
# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
# endif
#endif
#ifdef PERL_OBJECT
#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
#ifdef __cplusplus
extern "C" {
#endif
typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
#ifdef __cplusplus
}
#endif
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
#define SWIGCLASS_STATIC
#else /* PERL_OBJECT */
#define MAGIC_PPERL
#define SWIGCLASS_STATIC static SWIGUNUSED
#ifndef MULTIPLICITY
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*SwigMagicFunc)(SV *, MAGIC *);
#ifdef __cplusplus
}
#endif
#else /* MULTIPLICITY */
#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
#ifdef __cplusplus
}
#endif
#endif /* MULTIPLICITY */
#endif /* PERL_OBJECT */
/* Workaround for bug in perl 5.6.x croak and earlier */
#if (PERL_VERSION < 8)
# ifdef PERL_OBJECT
# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
static void SWIG_Perl_croak_null(CPerlObj *pPerl)
# else
static void SWIG_croak_null()
# endif
{
SV *err=ERRSV;
# if (PERL_VERSION < 6)
croak("%_", err);
# else
if (SvOK(err) && !SvROK(err)) croak("%_", err);
croak(Nullch);
# endif
}
#else
# define SWIG_croak_null() croak(Nullch)
#endif
/*
Define how strict is the cast between strings and integers/doubles
when overloading between these types occurs.
The default is making it as strict as possible by using SWIG_AddCast
when needed.
You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
disable the SWIG_AddCast, making the casting between string and
numbers less strict.
In the end, we try to solve the overloading between strings and
numerical types in the more natural way, but if you can avoid it,
well, avoid it using %rename, for example.
*/
#ifndef SWIG_PERL_NO_STRICT_STR2NUM
# ifndef SWIG_PERL_STRICT_STR2NUM
# define SWIG_PERL_STRICT_STR2NUM
# endif
#endif
#ifdef SWIG_PERL_STRICT_STR2NUM
/* string takes precedence */
#define SWIG_Str2NumCast(x) SWIG_AddCast(x)
#else
/* number takes precedence */
#define SWIG_Str2NumCast(x) x
#endif
#include
SWIGRUNTIME const char *
SWIG_Perl_TypeProxyName(const swig_type_info *type) {
if (!type) return NULL;
if (type->clientdata != NULL) {
return (const char*) type->clientdata;
}
else {
return type->name;
}
}
/* Identical to SWIG_TypeCheck, except for strcmp comparison */
SWIGRUNTIME swig_cast_info *
SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
if (ty) {
swig_cast_info *iter = ty->cast;
while (iter) {
if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) ||
(iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) {
if (iter == ty->cast)
return iter;
/* Move iter to the top of the linked list */
iter->prev->next = iter->next;
if (iter->next)
iter->next->prev = iter->prev;
iter->next = ty->cast;
iter->prev = 0;
if (ty->cast) ty->cast->prev = iter;
ty->cast = iter;
return iter;
}
iter = iter->next;
}
}
return 0;
}
/* Function for getting a pointer value */
SWIGRUNTIME int
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
swig_cast_info *tc;
void *voidptr = (void *)0;
SV *tsv = 0;
if (own)
*own = 0;
/* If magical, apply more magic */
if (SvGMAGICAL(sv))
mg_get(sv);
/* Check to see if this is an object */
if (sv_isobject(sv)) {
IV tmp = 0;
tsv = (SV*) SvRV(sv);
if ((SvTYPE(tsv) == SVt_PVHV)) {
MAGIC *mg;
if (SvMAGICAL(tsv)) {
mg = mg_find(tsv,'P');
if (mg) {
sv = mg->mg_obj;
if (sv_isobject(sv)) {
tsv = (SV*)SvRV(sv);
tmp = SvIV(tsv);
}
}
} else {
return SWIG_ERROR;
}
} else {
tmp = SvIV(tsv);
}
voidptr = INT2PTR(void *,tmp);
} else if (! SvOK(sv)) { /* Check for undef */
*(ptr) = (void *) 0;
return SWIG_OK;
} else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
if (!SvROK(sv)) {
/* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
if (SvIOK(sv)) {
return SWIG_ERROR;
} else {
/* NULL pointer (reference to undef). */
*(ptr) = (void *) 0;
return SWIG_OK;
}
} else {
return SWIG_ERROR;
}
} else { /* Don't know what it is */
return SWIG_ERROR;
}
if (_t) {
/* Now see if the types match */
char *_c = HvNAME(SvSTASH(SvRV(sv)));
tc = SWIG_TypeProxyCheck(_c,_t);
if (!tc) {
return SWIG_ERROR;
}
{
int newmemory = 0;
*ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
if (newmemory == SWIG_CAST_NEW_MEMORY) {
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
if (own)
*own = *own | SWIG_CAST_NEW_MEMORY;
}
}
} else {
*ptr = voidptr;
}
/*
* DISOWN implementation: we need a perl guru to check this one.
*/
if (tsv && (flags & SWIG_POINTER_DISOWN)) {
/*
* almost copy paste code from below SWIG_POINTER_OWN setting
*/
SV *obj = sv;
HV *stash = SvSTASH(SvRV(obj));
GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
if (isGV(gv)) {
HV *hv = GvHVn(gv);
/*
* To set ownership (see below), a newSViv(1) entry is added.
* Hence, to remove ownership, we delete the entry.
*/
if (hv_exists_ent(hv, obj, 0)) {
hv_delete_ent(hv, obj, 0, 0);
}
}
}
return SWIG_OK;
}
SWIGRUNTIME int
SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
}
SWIGRUNTIME void
SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
SV *self;
SV *obj=newSV(0);
HV *hash=newHV();
HV *stash;
sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
stash=SvSTASH(SvRV(obj));
if (flags & SWIG_POINTER_OWN) {
HV *hv;
GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
if (!isGV(gv))
gv_init(gv, stash, "OWNER", 5, FALSE);
hv=GvHVn(gv);
hv_store_ent(hv, obj, newSViv(1), 0);
}
sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
SvREFCNT_dec(obj);
self=newRV_noinc((SV *)hash);
sv_setsv(sv, self);
SvREFCNT_dec((SV *)self);
sv_bless(sv, stash);
}
else {
sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
}
}
SWIGRUNTIMEINLINE SV *
SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
SV *result = sv_newmortal();
SWIG_MakePtr(result, ptr, t, flags);
return result;
}
SWIGRUNTIME void
SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
char result[1024];
char *r = result;
if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
*(r++) = '_';
r = SWIG_PackData(r,ptr,sz);
strcpy(r,SWIG_Perl_TypeProxyName(type));
sv_setpv(sv, result);
}
SWIGRUNTIME SV *
SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
SV *result = sv_newmortal();
SWIG_Perl_MakePackedObj(result, ptr, sz, type);
return result;
}
/* Convert a packed value value */
SWIGRUNTIME int
SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
swig_cast_info *tc;
const char *c = 0;
if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
c = SvPV_nolen(obj);
/* Pointer values must start with leading underscore */
if (*c != '_') return SWIG_ERROR;
c++;
c = SWIG_UnpackData(c,ptr,sz);
if (ty) {
tc = SWIG_TypeCheck(c,ty);
if (!tc) return SWIG_ERROR;
}
return SWIG_OK;
}
/* Macros for low-level exception handling */
#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
typedef XSPROTO(SwigPerlWrapper);
typedef SwigPerlWrapper *SwigPerlWrapperPtr;
/* Structure for command table */
typedef struct {
const char *name;
SwigPerlWrapperPtr wrapper;
} swig_command_info;
/* Information for constant table */
#define SWIG_INT 1
#define SWIG_FLOAT 2
#define SWIG_STRING 3
#define SWIG_POINTER 4
#define SWIG_BINARY 5
/* Constant information structure */
typedef struct swig_constant_info {
int type;
const char *name;
long lvalue;
double dvalue;
void *pvalue;
swig_type_info **ptype;
} swig_constant_info;
/* Structure for variable table */
typedef struct {
const char *name;
SwigMagicFunc set;
SwigMagicFunc get;
swig_type_info **type;
} swig_variable_info;
/* Magic variable code */
#ifndef PERL_OBJECT
#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
#ifndef MULTIPLICITY
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
#else
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
#endif
#else
# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
#endif
{
MAGIC *mg;
sv_magic(sv,sv,'U',(char *) name,strlen(name));
mg = mg_find(sv,'U');
mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
mg->mg_virtual->svt_get = (SwigMagicFunc) get;
mg->mg_virtual->svt_set = (SwigMagicFunc) set;
mg->mg_virtual->svt_len = 0;
mg->mg_virtual->svt_clear = 0;
mg->mg_virtual->svt_free = 0;
}
SWIGRUNTIME swig_module_info *
SWIG_Perl_GetModule(void) {
static void *type_pointer = (void *)0;
SV *pointer;
/* first check if pointer already created */
if (!type_pointer) {
pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
if (pointer && SvOK(pointer)) {
type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
}
}
return (swig_module_info *) type_pointer;
}
SWIGRUNTIME void
SWIG_Perl_SetModule(swig_module_info *module) {
SV *pointer;
/* create a new pointer */
pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
sv_setiv(pointer, PTR2IV(module));
}
#ifdef __cplusplus
}
#endif
/* Workaround perl5 global namespace pollution. Note that undefining library
* functions like fopen will not solve the problem on all platforms as fopen
* might be a macro on Windows but not necessarily on other operating systems. */
#ifdef do_open
#undef do_open
#endif
#ifdef do_close
#undef do_close
#endif
#ifdef do_exec
#undef do_exec
#endif
#ifdef scalar
#undef scalar
#endif
#ifdef list
#undef list
#endif
#ifdef apply
#undef apply
#endif
#ifdef convert
#undef convert
#endif
#ifdef Error
#undef Error
#endif
#ifdef form
#undef form
#endif
#ifdef vform
#undef vform
#endif
#ifdef LABEL
#undef LABEL
#endif
#ifdef METHOD
#undef METHOD
#endif
#ifdef Move
#undef Move
#endif
#ifdef yylex
#undef yylex
#endif
#ifdef yyparse
#undef yyparse
#endif
#ifdef yyerror
#undef yyerror
#endif
#ifdef invert
#undef invert
#endif
#ifdef ref
#undef ref
#endif
#ifdef read
#undef read
#endif
#ifdef write
#undef write
#endif
#ifdef eof
#undef eof
#endif
#ifdef bool
#undef bool
#endif
#ifdef close
#undef close
#endif
#ifdef rewind
#undef rewind
#endif
#ifdef free
#undef free
#endif
#ifdef malloc
#undef malloc
#endif
#ifdef calloc
#undef calloc
#endif
#ifdef Stat
#undef Stat
#endif
#ifdef check
#undef check
#endif
#ifdef seekdir
#undef seekdir
#endif
#ifdef open
#undef open
#endif
#ifdef readdir
#undef readdir
#endif
#ifdef bind
#undef bind
#endif
#ifdef access
#undef access
#endif
#ifdef stat
#undef stat
#endif
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
#define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
/* -------- TYPES TABLE (BEGIN) -------- */
#define SWIGTYPE_p_MeCab__Lattice swig_types[0]
#define SWIGTYPE_p_MeCab__Model swig_types[1]
#define SWIGTYPE_p_MeCab__Tagger swig_types[2]
#define SWIGTYPE_p_char swig_types[3]
#define SWIGTYPE_p_mecab_dictionary_info_t swig_types[4]
#define SWIGTYPE_p_mecab_node_t swig_types[5]
#define SWIGTYPE_p_mecab_path_t swig_types[6]
#define SWIGTYPE_p_mecab_t swig_types[7]
#define SWIGTYPE_p_p_char swig_types[8]
static swig_type_info *swig_types[10];
static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
/* -------- TYPES TABLE (END) -------- */
#define SWIG_init boot_MeCab
#define SWIG_name "MeCabc::boot_MeCab"
#define SWIG_prefix "MeCabc::"
#define SWIGVERSION 0x020004
#define SWIG_VERSION SWIGVERSION
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
#include
#ifdef __cplusplus
extern "C"
#endif
#ifndef PERL_OBJECT
#ifndef MULTIPLICITY
SWIGEXPORT void SWIG_init (CV* cv);
#else
SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
#endif
#else
SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
#endif
#include "mecab.h"
/* Workaround for ruby1.9.x */
#if defined SWIGRUBY
#include "ruby/version.h"
#if RUBY_API_VERSION_CODE >= 10900
#include "ruby/encoding.h"
#define rb_str_new rb_external_str_new
#endif
#endif
MeCab::Tagger* new_MeCab_Tagger (const char *arg) {
char *p = new char [strlen(arg) + 4];
strcpy(p, "-C ");
strcat(p, arg);
MeCab::Tagger *tagger = MeCab::createTagger(p);
delete [] p;
if (! tagger) throw MeCab::getLastError();
return tagger;
}
MeCab::Tagger* new_MeCab_Tagger () {
MeCab::Tagger *tagger = MeCab::createTagger("-C");
if (! tagger) throw MeCab::getLastError();
return tagger;
}
void delete_MeCab_Tagger (MeCab::Tagger *t) {
delete t;
t = 0;
}
MeCab::Model* new_MeCab_Model (const char *arg) {
char *p = new char [strlen(arg) + 4];
strcpy(p, "-C ");
strcat(p, arg);
MeCab::Model *model = MeCab::createModel(p);
delete [] p;
if (! model) throw MeCab::getLastError();
return model;
}
MeCab::Model* new_MeCab_Model () {
MeCab::Model *model = MeCab::createModel("-C");
if (! model) throw MeCab::getLastError();
return model;
}
void delete_MeCab_Model (MeCab::Model *t) {
delete t;
t = 0;
}
MeCab::Lattice* new_MeCab_Lattice () {
return MeCab::createLattice();
}
void delete_MeCab_Lattice (MeCab::Lattice *t) {
delete t;
t = 0;
}
char* mecab_node_t_surface_get(mecab_node_t *n) {
char *s = new char [n->length + 1];
memcpy (s, n->surface, n->length);
s[n->length] = '\0';
return s;
}
SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
SV *obj = sv_newmortal();
if (carray) {
sv_setpvn(obj, carray, size);
} else {
sv_setsv(obj, &PL_sv_undef);
}
return obj;
}
SWIGINTERNINLINE SV *
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
SWIGINTERN int
SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
{
if (SvNIOK(obj)) {
if (val) *val = SvNV(obj);
return SWIG_OK;
} else if (SvIOK(obj)) {
if (val) *val = (double) SvIV(obj);
return SWIG_AddCast(SWIG_OK);
} else {
const char *nptr = SvPV_nolen(obj);
if (nptr) {
char *endptr;
double v;
errno = 0;
v = strtod(nptr, &endptr);
if (errno == ERANGE) {
errno = 0;
return SWIG_OverflowError;
} else {
if (*endptr == '\0') {
if (val) *val = v;
return SWIG_Str2NumCast(SWIG_OK);
}
}
}
}
return SWIG_TypeError;
}
SWIGINTERNINLINE SV *
SWIG_From_unsigned_SS_long SWIG_PERL_DECL_ARGS_1(unsigned long value)
{
SV *obj = sv_newmortal();
sv_setuv(obj, (UV) value);
return obj;
}
SWIGINTERNINLINE SV *
SWIG_From_unsigned_SS_int SWIG_PERL_DECL_ARGS_1(unsigned int value)
{
return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(value);
}
SWIGINTERNINLINE SV *
SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value)
{
SV *obj = sv_newmortal();
sv_setiv(obj, (IV) value);
return obj;
}
SWIGINTERNINLINE SV *
SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value)
{
return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value);
}
SWIGINTERNINLINE SV *
SWIG_From_unsigned_SS_short SWIG_PERL_DECL_ARGS_1(unsigned short value)
{
return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(value);
}
#include
SWIGINTERN int
SWIG_AsVal_float SWIG_PERL_DECL_ARGS_2(SV * obj, float *val)
{
double v;
int res = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj, &v);
if (SWIG_IsOK(res)) {
if ((v < -FLT_MAX || v > FLT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = static_cast< float >(v);
}
}
return res;
}
SWIGINTERNINLINE SV *
SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value)
{
SV *obj = sv_newmortal();
sv_setnv(obj, value);
return obj;
}
SWIGINTERNINLINE SV *
SWIG_From_float SWIG_PERL_DECL_ARGS_1(float value)
{
return SWIG_From_double SWIG_PERL_CALL_ARGS_1(value);
}
SWIGINTERNINLINE SV *
SWIG_From_unsigned_SS_char SWIG_PERL_DECL_ARGS_1(unsigned char value)
{
return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(value);
}
SWIGINTERNINLINE SV *
SWIG_From_short SWIG_PERL_DECL_ARGS_1(short value)
{
return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value);
}
SWIGINTERNINLINE SV *
SWIG_From_bool SWIG_PERL_DECL_ARGS_1(bool value)
{
SV *obj = sv_newmortal();
if (value) {
sv_setsv(obj, &PL_sv_yes);
} else {
sv_setsv(obj, &PL_sv_no);
}
return obj;
}
#include
SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double *d, double min, double max) {
double x = *d;
if ((min <= x && x <= max)) {
double fx = floor(x);
double cx = ceil(x);
double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
if ((errno == EDOM) || (errno == ERANGE)) {
errno = 0;
} else {
double summ, reps, diff;
if (rd < x) {
diff = x - rd;
} else if (rd > x) {
diff = rd - x;
} else {
return 1;
}
summ = rd + x;
reps = diff/summ;
if (reps < 8*DBL_EPSILON) {
*d = rd;
return 1;
}
}
}
return 0;
}
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
{
if (SvUOK(obj)) {
UV v = SvUV(obj);
if (v >= 0 && v <= ULONG_MAX) {
if (val) *val = v;
return SWIG_OK;
} else {
return SWIG_OverflowError;
}
} else if (SvIOK(obj)) {
IV v = SvIV(obj);
if (v >= 0 && v <= ULONG_MAX) {
if (val) *val = v;
return SWIG_OK;
} else {
return SWIG_OverflowError;
}
} else {
int dispatch = 0;
const char *nptr = SvPV_nolen(obj);
if (nptr) {
char *endptr;
unsigned long v;
errno = 0;
v = strtoul(nptr, &endptr,0);
if (errno == ERANGE) {
errno = 0;
return SWIG_OverflowError;
} else {
if (*endptr == '\0') {
if (val) *val = v;
return SWIG_Str2NumCast(SWIG_OK);
}
}
}
if (!dispatch) {
double d;
int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
if (val) *val = (unsigned long)(d);
return res;
}
}
}
return SWIG_TypeError;
}
SWIGINTERNINLINE int
SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
return res;
}
SWIGINTERNINLINE SV *
SWIG_From_size_t SWIG_PERL_DECL_ARGS_1(size_t value)
{
return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(static_cast< unsigned long >(value));
}
#include
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
# define LLONG_MAX __LONG_LONG_MAX__
# define LLONG_MIN (-LLONG_MAX - 1LL)
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif
SWIGINTERN int
SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
{
if (SvIOK(obj)) {
IV v = SvIV(obj);
if (v >= LONG_MIN && v <= LONG_MAX) {
if (val) *val = v;
return SWIG_OK;
} else {
return SWIG_OverflowError;
}
} else {
int dispatch = 0;
const char *nptr = SvPV_nolen(obj);
if (nptr) {
char *endptr;
long v;
errno = 0;
v = strtol(nptr, &endptr,0);
if (errno == ERANGE) {
errno = 0;
return SWIG_OverflowError;
} else {
if (*endptr == '\0') {
if (val) *val = v;
return SWIG_Str2NumCast(SWIG_OK);
}
}
}
if (!dispatch) {
double d;
int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
if (val) *val = (long)(d);
return res;
}
}
}
return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
{
long v;
int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
if (SWIG_IsOK(res)) {
if ((v < INT_MIN || v > INT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = static_cast< int >(v);
}
}
return res;
}
SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
static int init = 0;
static swig_type_info* info = 0;
if (!init) {
info = SWIG_TypeQuery("_p_char");
init = 1;
}
return info;
}
SWIGINTERN int
SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
{
if (SvMAGICAL(obj)) {
SV *tmp = sv_newmortal();
SvSetSV(tmp, obj);
obj = tmp;
}
if (SvPOK(obj)) {
STRLEN len = 0;
char *cstr = SvPV(obj, len);
size_t size = len + 1;
if (cptr) {
if (alloc) {
if (*alloc == SWIG_NEWOBJ) {
*cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
} else {
*cptr = cstr;
*alloc = SWIG_OLDOBJ;
}
}
}
if (psize) *psize = size;
return SWIG_OK;
} else {
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
if (pchar_descriptor) {
char* vptr = 0;
if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
if (cptr) *cptr = vptr;
if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
if (alloc) *alloc = SWIG_OLDOBJ;
return SWIG_OK;
}
}
}
return SWIG_TypeError;
}
SWIGINTERN void MeCab_Lattice_set_sentence(MeCab::Lattice *self,char const *sentence){
self->add_request_type(MECAB_ALLOCATE_SENTENCE);
self->set_sentence(sentence);
}
SWIGINTERN int
SWIG_AsVal_unsigned_SS_short SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned short *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, &v);
if (SWIG_IsOK(res)) {
if ((v > USHRT_MAX)) {
return SWIG_OverflowError;
} else {
if (val) *val = static_cast< unsigned short >(v);
}
}
return res;
}
SWIGINTERN int
SWIG_AsVal_bool SWIG_PERL_DECL_ARGS_2(SV *obj, bool* val)
{
if (obj == &PL_sv_yes) {
if (val) *val = true;
return SWIG_OK;
} else if (obj == &PL_sv_no) {
if (val) *val = false;
return SWIG_OK;
} else {
if (val) *val = SvTRUE(obj) ? true: false;
return SWIG_AddCast(SWIG_OK);
}
return SWIG_TypeError;
}
SWIGINTERN char const *MeCab_Tagger_parseToString__SWIG_0(MeCab::Tagger *self,char const *str,size_t length=0){
return self->parse(str, length);
}
#ifdef __cplusplus
extern "C" {
#endif
#ifdef PERL_OBJECT
#define MAGIC_CLASS _wrap_MeCab_var::
class _wrap_MeCab_var : public CPerlObj {
public:
#else
#define MAGIC_CLASS
#endif
SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
MAGIC_PPERL
croak("Value is read-only.");
return 0;
}
#ifdef PERL_OBJECT
};
#endif
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
XS(_wrap_DictionaryInfo_filename_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_filename_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_filename_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (char *) ((arg1)->filename);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_DictionaryInfo_charset_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_charset_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_charset_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (char *) ((arg1)->charset);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_DictionaryInfo_size_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_size_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_size_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (unsigned int) ((arg1)->size);
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_DictionaryInfo_type_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_type_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_type_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (int) ((arg1)->type);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_DictionaryInfo_lsize_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_lsize_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_lsize_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (unsigned int) ((arg1)->lsize);
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_DictionaryInfo_rsize_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_rsize_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_rsize_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (unsigned int) ((arg1)->rsize);
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_DictionaryInfo_version_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned short result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_version_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_version_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (unsigned short) ((arg1)->version);
ST(argvi) = SWIG_From_unsigned_SS_short SWIG_PERL_CALL_ARGS_1(static_cast< unsigned short >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_DictionaryInfo_next_get) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_dictionary_info_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: DictionaryInfo_next_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DictionaryInfo_next_get" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
result = (mecab_dictionary_info_t *) ((arg1)->next);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_dictionary_info_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_new_DictionaryInfo) {
{
int argvi = 0;
mecab_dictionary_info_t *result = 0 ;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: new_DictionaryInfo();");
}
{
try {
result = (mecab_dictionary_info_t *)new mecab_dictionary_info_t();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_dictionary_info_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_delete_DictionaryInfo) {
{
mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: delete_DictionaryInfo(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_dictionary_info_t, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DictionaryInfo" "', argument " "1"" of type '" "mecab_dictionary_info_t *""'");
}
arg1 = reinterpret_cast< mecab_dictionary_info_t * >(argp1);
{
try {
delete arg1;
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Path_rnode_get) {
{
mecab_path_t *arg1 = (mecab_path_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_node_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Path_rnode_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_rnode_get" "', argument " "1"" of type '" "mecab_path_t *""'");
}
arg1 = reinterpret_cast< mecab_path_t * >(argp1);
result = (mecab_node_t *) ((arg1)->rnode);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Path_rnext_get) {
{
mecab_path_t *arg1 = (mecab_path_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_path_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Path_rnext_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_rnext_get" "', argument " "1"" of type '" "mecab_path_t *""'");
}
arg1 = reinterpret_cast< mecab_path_t * >(argp1);
result = (mecab_path_t *) ((arg1)->rnext);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_path_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Path_lnode_get) {
{
mecab_path_t *arg1 = (mecab_path_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_node_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Path_lnode_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_lnode_get" "', argument " "1"" of type '" "mecab_path_t *""'");
}
arg1 = reinterpret_cast< mecab_path_t * >(argp1);
result = (mecab_node_t *) ((arg1)->lnode);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Path_lnext_get) {
{
mecab_path_t *arg1 = (mecab_path_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_path_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Path_lnext_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_lnext_get" "', argument " "1"" of type '" "mecab_path_t *""'");
}
arg1 = reinterpret_cast< mecab_path_t * >(argp1);
result = (mecab_path_t *) ((arg1)->lnext);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_path_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Path_cost_get) {
{
mecab_path_t *arg1 = (mecab_path_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Path_cost_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_cost_get" "', argument " "1"" of type '" "mecab_path_t *""'");
}
arg1 = reinterpret_cast< mecab_path_t * >(argp1);
result = (int) ((arg1)->cost);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Path_prob_set) {
{
mecab_path_t *arg1 = (mecab_path_t *) 0 ;
float arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
float val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Path_prob_set(self,prob);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_prob_set" "', argument " "1"" of type '" "mecab_path_t *""'");
}
arg1 = reinterpret_cast< mecab_path_t * >(argp1);
ecode2 = SWIG_AsVal_float SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Path_prob_set" "', argument " "2"" of type '" "float""'");
}
arg2 = static_cast< float >(val2);
if (arg1) (arg1)->prob = arg2;
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Path_prob_get) {
{
mecab_path_t *arg1 = (mecab_path_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
float result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Path_prob_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_path_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Path_prob_get" "', argument " "1"" of type '" "mecab_path_t *""'");
}
arg1 = reinterpret_cast< mecab_path_t * >(argp1);
result = (float) ((arg1)->prob);
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_prev_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_node_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_prev_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_prev_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (mecab_node_t *) ((arg1)->prev);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_next_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_node_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_next_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_next_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (mecab_node_t *) ((arg1)->next);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_enext_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_node_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_enext_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_enext_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (mecab_node_t *) ((arg1)->enext);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_bnext_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_node_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_bnext_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_bnext_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (mecab_node_t *) ((arg1)->bnext);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_rpath_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_path_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_rpath_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_rpath_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (mecab_path_t *) ((arg1)->rpath);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_path_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_lpath_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
mecab_path_t *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_lpath_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_lpath_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (mecab_path_t *) ((arg1)->lpath);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_path_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_feature_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_feature_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_feature_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (char *) ((arg1)->feature);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_id_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_id_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_id_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned int) ((arg1)->id);
ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_length_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned short result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_length_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_length_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned short) ((arg1)->length);
ST(argvi) = SWIG_From_unsigned_SS_short SWIG_PERL_CALL_ARGS_1(static_cast< unsigned short >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_rlength_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned short result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_rlength_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_rlength_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned short) ((arg1)->rlength);
ST(argvi) = SWIG_From_unsigned_SS_short SWIG_PERL_CALL_ARGS_1(static_cast< unsigned short >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_rcAttr_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned short result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_rcAttr_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_rcAttr_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned short) ((arg1)->rcAttr);
ST(argvi) = SWIG_From_unsigned_SS_short SWIG_PERL_CALL_ARGS_1(static_cast< unsigned short >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_lcAttr_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned short result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_lcAttr_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_lcAttr_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned short) ((arg1)->lcAttr);
ST(argvi) = SWIG_From_unsigned_SS_short SWIG_PERL_CALL_ARGS_1(static_cast< unsigned short >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_posid_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned short result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_posid_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_posid_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned short) ((arg1)->posid);
ST(argvi) = SWIG_From_unsigned_SS_short SWIG_PERL_CALL_ARGS_1(static_cast< unsigned short >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_char_type_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned char result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_char_type_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_char_type_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned char) ((arg1)->char_type);
ST(argvi) = SWIG_From_unsigned_SS_char SWIG_PERL_CALL_ARGS_1(static_cast< unsigned char >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_stat_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned char result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_stat_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_stat_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned char) ((arg1)->stat);
ST(argvi) = SWIG_From_unsigned_SS_char SWIG_PERL_CALL_ARGS_1(static_cast< unsigned char >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_isbest_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
unsigned char result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_isbest_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_isbest_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (unsigned char) ((arg1)->isbest);
ST(argvi) = SWIG_From_unsigned_SS_char SWIG_PERL_CALL_ARGS_1(static_cast< unsigned char >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_alpha_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
float result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_alpha_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_alpha_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (float) ((arg1)->alpha);
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_beta_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
float result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_beta_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_beta_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (float) ((arg1)->beta);
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_prob_set) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
float arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
float val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Node_prob_set(self,prob);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_prob_set" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
ecode2 = SWIG_AsVal_float SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Node_prob_set" "', argument " "2"" of type '" "float""'");
}
arg2 = static_cast< float >(val2);
if (arg1) (arg1)->prob = arg2;
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_prob_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
float result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_prob_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_prob_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (float) ((arg1)->prob);
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_wcost_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
short result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_wcost_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_wcost_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (short) ((arg1)->wcost);
ST(argvi) = SWIG_From_short SWIG_PERL_CALL_ARGS_1(static_cast< short >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_cost_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
long result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_cost_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_cost_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
result = (long) ((arg1)->cost);
ST(argvi) = SWIG_From_long SWIG_PERL_CALL_ARGS_1(static_cast< long >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Node_surface_get) {
{
mecab_node_t *arg1 = (mecab_node_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Node_surface_get(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Node_surface_get" "', argument " "1"" of type '" "mecab_node_t *""'");
}
arg1 = reinterpret_cast< mecab_node_t * >(argp1);
{
try {
result = (char *)mecab_node_t_surface_get(arg1);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
delete[] result;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_clear) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_clear(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_clear" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
(arg1)->clear();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_is_available) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_is_available(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_is_available" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (bool)((MeCab::Lattice const *)arg1)->is_available();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_bos_node) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_bos_node(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_bos_node" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->bos_node();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_eos_node) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_eos_node(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_eos_node" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->eos_node();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_end_nodes) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
size_t arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_end_nodes(self,pos);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_end_nodes" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_end_nodes" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
{
try {
result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->end_nodes(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_begin_nodes) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
size_t arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_begin_nodes(self,pos);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_begin_nodes" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_begin_nodes" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
{
try {
result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->begin_nodes(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_sentence) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_sentence(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_sentence" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (char *)((MeCab::Lattice const *)arg1)->sentence();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_size) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
size_t result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_size(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_size" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = ((MeCab::Lattice const *)arg1)->size();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_size_t SWIG_PERL_CALL_ARGS_1(static_cast< size_t >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_Z) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
double arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
double val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_set_Z(self,Z);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_Z" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_Z" "', argument " "2"" of type '" "double""'");
}
arg2 = static_cast< double >(val2);
{
try {
(arg1)->set_Z(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_Z) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
double result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_Z(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_Z" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (double)((MeCab::Lattice const *)arg1)->Z();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_double SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_theta) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
float arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
float val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_set_theta(self,theta);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_theta" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_float SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_theta" "', argument " "2"" of type '" "float""'");
}
arg2 = static_cast< float >(val2);
{
try {
(arg1)->set_theta(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_theta) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
float result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_theta(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_theta" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (float)((MeCab::Lattice const *)arg1)->theta();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_next) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_next(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_next" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (bool)(arg1)->next();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_request_type) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_request_type(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_request_type" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (int)((MeCab::Lattice const *)arg1)->request_type();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_has_request_type) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_has_request_type(self,request_type);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_has_request_type" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_has_request_type" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
try {
result = (bool)((MeCab::Lattice const *)arg1)->has_request_type(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_request_type) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_set_request_type(self,request_type);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_request_type" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_request_type" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
try {
(arg1)->set_request_type(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_add_request_type) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_add_request_type(self,request_type);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_add_request_type" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_add_request_type" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
try {
(arg1)->add_request_type(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_remove_request_type) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_remove_request_type(self,request_type);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_remove_request_type" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_remove_request_type" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
try {
(arg1)->remove_request_type(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_newNode) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_newNode(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_newNode" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (MeCab::Node *)(arg1)->newNode();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_toString__SWIG_0) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_toString(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_toString" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (char *)(arg1)->toString();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_toString__SWIG_1) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
MeCab::Node *arg2 = (MeCab::Node *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_toString(self,node);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_toString" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_toString" "', argument " "2"" of type '" "MeCab::Node const *""'");
}
arg2 = reinterpret_cast< MeCab::Node * >(argp2);
{
try {
result = (char *)(arg1)->toString((MeCab::Node const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_toString) {
dXSARGS;
{
unsigned long _index = 0;
SWIG_TypeRank _rank = 0;
if (items == 1) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Lattice, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 1;
if (_rank == _rankm) goto dispatch;
}
}
check_1:
if (items == 2) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Lattice, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_mecab_node_t, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 2;
if (_rank == _rankm) goto dispatch;
}
}
check_2:
dispatch:
switch(_index) {
case 1:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Lattice_toString__SWIG_0); return;
case 2:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Lattice_toString__SWIG_1); return;
}
}
croak("No matching function for overloaded 'Lattice_toString'");
XSRETURN(0);
}
XS(_wrap_Lattice_enumNBestAsString) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
size_t arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_enumNBestAsString(self,N);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_enumNBestAsString" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_enumNBestAsString" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
{
try {
result = (char *)(arg1)->enumNBestAsString(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_has_constraint) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_has_constraint(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_has_constraint" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (bool)((MeCab::Lattice const *)arg1)->has_constraint();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_boundary_constraint) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
size_t arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_boundary_constraint(self,pos);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_boundary_constraint" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_boundary_constraint" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
{
try {
result = (int)((MeCab::Lattice const *)arg1)->boundary_constraint(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_feature_constraint) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
size_t arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_feature_constraint(self,pos);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_feature_constraint" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_feature_constraint" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
{
try {
result = (char *)((MeCab::Lattice const *)arg1)->feature_constraint(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_boundary_constraint) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
size_t arg2 ;
int arg3 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int val3 ;
int ecode3 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 3) || (items > 3)) {
SWIG_croak("Usage: Lattice_set_boundary_constraint(self,pos,boundary_constraint_type);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_boundary_constraint" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_boundary_constraint" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Lattice_set_boundary_constraint" "', argument " "3"" of type '" "int""'");
}
arg3 = static_cast< int >(val3);
{
try {
(arg1)->set_boundary_constraint(arg2,arg3);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_feature_constraint) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
size_t arg2 ;
size_t arg3 ;
char *arg4 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
size_t val3 ;
int ecode3 = 0 ;
int res4 ;
char *buf4 = 0 ;
int alloc4 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 4) || (items > 4)) {
SWIG_croak("Usage: Lattice_set_feature_constraint(self,begin_pos,end_pos,feature);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_feature_constraint" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Lattice_set_feature_constraint" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
ecode3 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Lattice_set_feature_constraint" "', argument " "3"" of type '" "size_t""'");
}
arg3 = static_cast< size_t >(val3);
res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Lattice_set_feature_constraint" "', argument " "4"" of type '" "char const *""'");
}
arg4 = reinterpret_cast< char * >(buf4);
{
try {
(arg1)->set_feature_constraint(arg2,arg3,(char const *)arg4);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
XSRETURN(argvi);
fail:
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_result) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_set_result(self,result);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_result" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_set_result" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
{
try {
(arg1)->set_result((char const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_Lattice_what) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Lattice_what(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_what" "', argument " "1"" of type '" "MeCab::Lattice const *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
result = (char *)((MeCab::Lattice const *)arg1)->what();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_what) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_set_what(self,str);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_what" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_set_what" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
{
try {
(arg1)->set_what((char const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_delete_Lattice) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: delete_Lattice(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Lattice" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
{
try {
delete arg1;
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_new_Lattice) {
{
int argvi = 0;
MeCab::Lattice *result = 0 ;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: new_Lattice();");
}
{
try {
result = (MeCab::Lattice *)new_MeCab_Lattice();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Lattice_set_sentence) {
{
MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Lattice_set_sentence(self,sentence);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Lattice_set_sentence" "', argument " "1"" of type '" "MeCab::Lattice *""'");
}
arg1 = reinterpret_cast< MeCab::Lattice * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Lattice_set_sentence" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
{
try {
MeCab_Lattice_set_sentence(arg1,(char const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_Model_dictionary_info) {
{
MeCab::Model *arg1 = (MeCab::Model *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::DictionaryInfo *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Model_dictionary_info(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_dictionary_info" "', argument " "1"" of type '" "MeCab::Model const *""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
{
try {
result = (MeCab::DictionaryInfo *)((MeCab::Model const *)arg1)->dictionary_info();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_dictionary_info_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Model_transition_cost) {
{
MeCab::Model *arg1 = (MeCab::Model *) 0 ;
unsigned short arg2 ;
unsigned short arg3 ;
void *argp1 = 0 ;
int res1 = 0 ;
unsigned short val2 ;
int ecode2 = 0 ;
unsigned short val3 ;
int ecode3 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 3) || (items > 3)) {
SWIG_croak("Usage: Model_transition_cost(self,rcAttr,lcAttr);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_transition_cost" "', argument " "1"" of type '" "MeCab::Model const *""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
ecode2 = SWIG_AsVal_unsigned_SS_short SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Model_transition_cost" "', argument " "2"" of type '" "unsigned short""'");
}
arg2 = static_cast< unsigned short >(val2);
ecode3 = SWIG_AsVal_unsigned_SS_short SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Model_transition_cost" "', argument " "3"" of type '" "unsigned short""'");
}
arg3 = static_cast< unsigned short >(val3);
{
try {
result = (int)((MeCab::Model const *)arg1)->transition_cost(arg2,arg3);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Model_lookup) {
{
MeCab::Model *arg1 = (MeCab::Model *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
MeCab::Lattice *arg4 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
void *argp4 = 0 ;
int res4 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 4) || (items > 4)) {
SWIG_croak("Usage: Model_lookup(self,begin,end,lattice);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_lookup" "', argument " "1"" of type '" "MeCab::Model const *""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_lookup" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Model_lookup" "', argument " "3"" of type '" "char const *""'");
}
arg3 = reinterpret_cast< char * >(buf3);
res4 = SWIG_ConvertPtr(ST(3), &argp4,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Model_lookup" "', argument " "4"" of type '" "MeCab::Lattice *""'");
}
arg4 = reinterpret_cast< MeCab::Lattice * >(argp4);
{
try {
result = (MeCab::Node *)((MeCab::Model const *)arg1)->lookup((char const *)arg2,(char const *)arg3,arg4);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
SWIG_croak_null();
}
}
XS(_wrap_Model_createTagger) {
{
MeCab::Model *arg1 = (MeCab::Model *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::Tagger *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Model_createTagger(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_createTagger" "', argument " "1"" of type '" "MeCab::Model const *""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
{
try {
result = (MeCab::Tagger *)((MeCab::Model const *)arg1)->createTagger();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Model_createLattice) {
{
MeCab::Model *arg1 = (MeCab::Model *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::Lattice *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Model_createLattice(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_createLattice" "', argument " "1"" of type '" "MeCab::Model const *""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
{
try {
result = (MeCab::Lattice *)((MeCab::Model const *)arg1)->createLattice();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Lattice, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Model_swap) {
{
MeCab::Model *arg1 = (MeCab::Model *) 0 ;
MeCab::Model *arg2 = (MeCab::Model *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Model_swap(self,model);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Model, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_swap" "', argument " "1"" of type '" "MeCab::Model *""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_MeCab__Model, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_swap" "', argument " "2"" of type '" "MeCab::Model *""'");
}
arg2 = reinterpret_cast< MeCab::Model * >(argp2);
{
try {
result = (bool)(arg1)->swap(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Model_version) {
{
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: Model_version();");
}
{
try {
result = (char *)MeCab::Model::version();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_delete_Model) {
{
MeCab::Model *arg1 = (MeCab::Model *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: delete_Model(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Model, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Model" "', argument " "1"" of type '" "MeCab::Model *""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
{
try {
delete arg1;
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Model_create__SWIG_0) {
{
int arg1 ;
char **arg2 = (char **) 0 ;
int val1 ;
int ecode1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
MeCab::Model *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Model_create(argc,argv);");
}
ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Model_create" "', argument " "1"" of type '" "int""'");
}
arg1 = static_cast< int >(val1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_p_char, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Model_create" "', argument " "2"" of type '" "char **""'");
}
arg2 = reinterpret_cast< char ** >(argp2);
{
try {
result = (MeCab::Model *)MeCab::Model::create(arg1,arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Model_create__SWIG_1) {
{
char *arg1 = (char *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
int argvi = 0;
MeCab::Model *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Model_create(arg);");
}
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Model_create" "', argument " "1"" of type '" "char const *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
{
try {
result = (MeCab::Model *)MeCab::Model::create((char const *)arg1);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, 0 | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
XSRETURN(argvi);
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
SWIG_croak_null();
}
}
XS(_wrap_Model_create) {
dXSARGS;
{
unsigned long _index = 0;
SWIG_TypeRank _rank = 0;
if (items == 1) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 1;
if (_rank == _rankm) goto dispatch;
}
}
check_1:
if (items == 2) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
{
int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
_v = SWIG_CheckState(res);
}
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_p_char, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 2;
if (_rank == _rankm) goto dispatch;
}
}
check_2:
dispatch:
switch(_index) {
case 1:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Model_create__SWIG_1); return;
case 2:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Model_create__SWIG_0); return;
}
}
croak("No matching function for overloaded 'Model_create'");
XSRETURN(0);
}
XS(_wrap_new_Model__SWIG_0) {
{
char *arg1 = (char *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
int argvi = 0;
MeCab::Model *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: new_Model(argc);");
}
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Model" "', argument " "1"" of type '" "char const *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
{
try {
result = (MeCab::Model *)new_MeCab_Model((char const *)arg1);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
XSRETURN(argvi);
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
SWIG_croak_null();
}
}
XS(_wrap_new_Model__SWIG_1) {
{
int argvi = 0;
MeCab::Model *result = 0 ;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: new_Model();");
}
{
try {
result = (MeCab::Model *)new_MeCab_Model();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Model, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_new_Model) {
dXSARGS;
{
unsigned long _index = 0;
SWIG_TypeRank _rank = 0;
if (items == 0) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 1;
if (_rank == _rankm) goto dispatch;
}
}
if (items == 1) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 2;
if (_rank == _rankm) goto dispatch;
}
}
check_2:
dispatch:
switch(_index) {
case 1:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Model__SWIG_1); return;
case 2:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Model__SWIG_0); return;
}
}
croak("No matching function for overloaded 'new_Model'");
XSRETURN(0);
}
XS(_wrap_Tagger_parse__SWIG_0) {
{
MeCab::Model *arg1 = 0 ;
MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ;
void *argp1 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_parse(model,lattice);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1, SWIGTYPE_p_MeCab__Model, 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Model const &""'");
}
if (!argp1) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Model const &""'");
}
arg1 = reinterpret_cast< MeCab::Model * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parse" "', argument " "2"" of type '" "MeCab::Lattice *""'");
}
arg2 = reinterpret_cast< MeCab::Lattice * >(argp2);
{
try {
result = (bool)MeCab::Tagger::parse((MeCab::Model const &)*arg1,arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_parse__SWIG_1) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_parse(self,lattice);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_MeCab__Lattice, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parse" "', argument " "2"" of type '" "MeCab::Lattice *""'");
}
arg2 = reinterpret_cast< MeCab::Lattice * >(argp2);
{
try {
result = (bool)((MeCab::Tagger const *)arg1)->parse(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_parse__SWIG_2) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_parse(self,str);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parse" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parse" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
{
try {
result = (char *)(arg1)->parse((char const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_Tagger_parse) {
dXSARGS;
{
unsigned long _index = 0;
SWIG_TypeRank _rank = 0;
if (items == 2) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Model, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_MeCab__Lattice, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 1;
if (_rank == _rankm) goto dispatch;
}
}
check_1:
if (items == 2) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Tagger, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_MeCab__Lattice, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 2;
if (_rank == _rankm) goto dispatch;
}
}
check_2:
if (items == 2) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Tagger, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_3;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_3;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 3;
if (_rank == _rankm) goto dispatch;
}
}
check_3:
dispatch:
switch(_index) {
case 1:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parse__SWIG_0); return;
case 2:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parse__SWIG_1); return;
case 3:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parse__SWIG_2); return;
}
}
croak("No matching function for overloaded 'Tagger_parse'");
XSRETURN(0);
}
XS(_wrap_Tagger_parseToNode) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_parseToNode(self,str);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseToNode" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseToNode" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
{
try {
result = (MeCab::Node *)(arg1)->parseToNode((char const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_Tagger_parseNBest) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
size_t arg2 ;
char *arg3 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 3) || (items > 3)) {
SWIG_croak("Usage: Tagger_parseNBest(self,N,str);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseNBest" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_parseNBest" "', argument " "2"" of type '" "size_t""'");
}
arg2 = static_cast< size_t >(val2);
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Tagger_parseNBest" "', argument " "3"" of type '" "char const *""'");
}
arg3 = reinterpret_cast< char * >(buf3);
{
try {
result = (char *)(arg1)->parseNBest(arg2,(char const *)arg3);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
XSRETURN(argvi);
fail:
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
SWIG_croak_null();
}
}
XS(_wrap_Tagger_parseNBestInit) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_parseNBestInit(self,str);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseNBestInit" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseNBestInit" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
{
try {
result = (bool)(arg1)->parseNBestInit((char const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_Tagger_nextNode) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::Node *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_nextNode(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_nextNode" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (MeCab::Node *)(arg1)->nextNode();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_node_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_next) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_next(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_next" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (char *)(arg1)->next();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_formatNode) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
MeCab::Node *arg2 = (MeCab::Node *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_formatNode(self,node);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_formatNode" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_mecab_node_t, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_formatNode" "', argument " "2"" of type '" "MeCab::Node const *""'");
}
arg2 = reinterpret_cast< MeCab::Node * >(argp2);
{
try {
result = (char *)(arg1)->formatNode((MeCab::Node const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_set_request_type) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_set_request_type(self,request_type);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_request_type" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_request_type" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
try {
(arg1)->set_request_type(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_request_type) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_request_type(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_request_type" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (int)((MeCab::Tagger const *)arg1)->request_type();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_partial) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_partial(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_partial" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (bool)((MeCab::Tagger const *)arg1)->partial();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_set_partial) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
bool arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_set_partial(self,partial);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_partial" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
ecode2 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_partial" "', argument " "2"" of type '" "bool""'");
}
arg2 = static_cast< bool >(val2);
{
try {
(arg1)->set_partial(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_lattice_level) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_lattice_level(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_lattice_level" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (int)((MeCab::Tagger const *)arg1)->lattice_level();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_set_lattice_level) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_set_lattice_level(self,level);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_lattice_level" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_lattice_level" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
try {
(arg1)->set_lattice_level(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_all_morphs) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_all_morphs(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_all_morphs" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (bool)((MeCab::Tagger const *)arg1)->all_morphs();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_set_all_morphs) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
bool arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
bool val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_set_all_morphs(self,all_morphs);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_all_morphs" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
ecode2 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_all_morphs" "', argument " "2"" of type '" "bool""'");
}
arg2 = static_cast< bool >(val2);
{
try {
(arg1)->set_all_morphs(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_set_theta) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
float arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
float val2 ;
int ecode2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_set_theta(self,theta);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_set_theta" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
ecode2 = SWIG_AsVal_float SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tagger_set_theta" "', argument " "2"" of type '" "float""'");
}
arg2 = static_cast< float >(val2);
{
try {
(arg1)->set_theta(arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_theta) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
float result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_theta(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_theta" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (float)((MeCab::Tagger const *)arg1)->theta();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_dictionary_info) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
MeCab::DictionaryInfo *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_dictionary_info(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_dictionary_info" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (MeCab::DictionaryInfo *)((MeCab::Tagger const *)arg1)->dictionary_info();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_mecab_dictionary_info_t, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_what) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_what(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_what" "', argument " "1"" of type '" "MeCab::Tagger const *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
result = (char *)((MeCab::Tagger const *)arg1)->what();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_delete_Tagger) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: delete_Tagger(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Tagger" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
{
try {
delete arg1;
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_create__SWIG_0) {
{
int arg1 ;
char **arg2 = (char **) 0 ;
int val1 ;
int ecode1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
MeCab::Tagger *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_create(argc,argv);");
}
ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Tagger_create" "', argument " "1"" of type '" "int""'");
}
arg1 = static_cast< int >(val1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_p_char, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_create" "', argument " "2"" of type '" "char **""'");
}
arg2 = reinterpret_cast< char ** >(argp2);
{
try {
result = (MeCab::Tagger *)MeCab::Tagger::create(arg1,arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_Tagger_create__SWIG_1) {
{
char *arg1 = (char *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
int argvi = 0;
MeCab::Tagger *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Tagger_create(arg);");
}
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_create" "', argument " "1"" of type '" "char const *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
{
try {
result = (MeCab::Tagger *)MeCab::Tagger::create((char const *)arg1);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, 0 | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
XSRETURN(argvi);
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
SWIG_croak_null();
}
}
XS(_wrap_Tagger_create) {
dXSARGS;
{
unsigned long _index = 0;
SWIG_TypeRank _rank = 0;
if (items == 1) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 1;
if (_rank == _rankm) goto dispatch;
}
}
check_1:
if (items == 2) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
{
int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), NULL);
_v = SWIG_CheckState(res);
}
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(1), &vptr, SWIGTYPE_p_p_char, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 2;
if (_rank == _rankm) goto dispatch;
}
}
check_2:
dispatch:
switch(_index) {
case 1:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_create__SWIG_1); return;
case 2:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_create__SWIG_0); return;
}
}
croak("No matching function for overloaded 'Tagger_create'");
XSRETURN(0);
}
XS(_wrap_Tagger_version) {
{
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: Tagger_version();");
}
{
try {
result = (char *)MeCab::Tagger::version();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_new_Tagger__SWIG_0) {
{
char *arg1 = (char *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
int argvi = 0;
MeCab::Tagger *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: new_Tagger(argc);");
}
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Tagger" "', argument " "1"" of type '" "char const *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
{
try {
result = (MeCab::Tagger *)new_MeCab_Tagger((char const *)arg1);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
XSRETURN(argvi);
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
SWIG_croak_null();
}
}
XS(_wrap_new_Tagger__SWIG_1) {
{
int argvi = 0;
MeCab::Tagger *result = 0 ;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: new_Tagger();");
}
{
try {
result = (MeCab::Tagger *)new_MeCab_Tagger();
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MeCab__Tagger, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_new_Tagger) {
dXSARGS;
{
unsigned long _index = 0;
SWIG_TypeRank _rank = 0;
if (items == 0) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 1;
if (_rank == _rankm) goto dispatch;
}
}
if (items == 1) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
int res = SWIG_AsCharPtrAndSize(ST(0), 0, NULL, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 2;
if (_rank == _rankm) goto dispatch;
}
}
check_2:
dispatch:
switch(_index) {
case 1:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Tagger__SWIG_1); return;
case 2:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_new_Tagger__SWIG_0); return;
}
}
croak("No matching function for overloaded 'new_Tagger'");
XSRETURN(0);
}
XS(_wrap_Tagger_parseToString__SWIG_0) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
char *arg2 = (char *) 0 ;
size_t arg3 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
size_t val3 ;
int ecode3 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 3) || (items > 3)) {
SWIG_croak("Usage: Tagger_parseToString(self,str,length);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseToString" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseToString" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
ecode3 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Tagger_parseToString" "', argument " "3"" of type '" "size_t""'");
}
arg3 = static_cast< size_t >(val3);
{
try {
result = (char *)MeCab_Tagger_parseToString__SWIG_0(arg1,(char const *)arg2,arg3);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_Tagger_parseToString__SWIG_1) {
{
MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
char *result = 0 ;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Tagger_parseToString(self,str);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MeCab__Tagger, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tagger_parseToString" "', argument " "1"" of type '" "MeCab::Tagger *""'");
}
arg1 = reinterpret_cast< MeCab::Tagger * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Tagger_parseToString" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
{
try {
result = (char *)MeCab_Tagger_parseToString__SWIG_0(arg1,(char const *)arg2);
}
catch (char *e) {
SWIG_exception (SWIG_RuntimeError, e);
}
catch (const char *e) {
SWIG_exception (SWIG_RuntimeError, (char*)e);
}
}
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_Tagger_parseToString) {
dXSARGS;
{
unsigned long _index = 0;
SWIG_TypeRank _rank = 0;
if (items == 2) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Tagger, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 1;
if (_rank == _rankm) goto dispatch;
}
}
check_1:
if (items == 3) {
SWIG_TypeRank _ranki = 0;
SWIG_TypeRank _rankm = 0;
SWIG_TypeRank _pi = 1;
int _v = 0;
{
void *vptr = 0;
int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_MeCab__Tagger, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
{
{
int res = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(2), NULL);
_v = SWIG_CheckState(res);
}
}
if (!_v) goto check_2;
_ranki += _v*_pi;
_rankm += _pi;
_pi *= SWIG_MAXCASTRANK;
if (!_index || (_ranki < _rank)) {
_rank = _ranki; _index = 2;
if (_rank == _rankm) goto dispatch;
}
}
check_2:
dispatch:
switch(_index) {
case 1:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parseToString__SWIG_1); return;
case 2:
++PL_markstack_ptr; SWIG_CALLXS(_wrap_Tagger_parseToString__SWIG_0); return;
}
}
croak("No matching function for overloaded 'Tagger_parseToString'");
XSRETURN(0);
}
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_MeCab__Lattice = {"_p_MeCab__Lattice", "MeCab::Lattice *", 0, 0, (void*)"MeCab::Lattice", 0};
static swig_type_info _swigt__p_MeCab__Model = {"_p_MeCab__Model", "MeCab::Model *", 0, 0, (void*)"MeCab::Model", 0};
static swig_type_info _swigt__p_MeCab__Tagger = {"_p_MeCab__Tagger", "MeCab::Tagger *", 0, 0, (void*)"MeCab::Tagger", 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_mecab_dictionary_info_t = {"_p_mecab_dictionary_info_t", "MeCab::DictionaryInfo *|mecab_dictionary_info_t *", 0, 0, (void*)"MeCab::DictionaryInfo", 0};
static swig_type_info _swigt__p_mecab_node_t = {"_p_mecab_node_t", "mecab_node_t *|MeCab::Node *", 0, 0, (void*)"MeCab::Node", 0};
static swig_type_info _swigt__p_mecab_path_t = {"_p_mecab_path_t", "mecab_path_t *|MeCab::Path *", 0, 0, (void*)"MeCab::Path", 0};
static swig_type_info _swigt__p_mecab_t = {"_p_mecab_t", "mecab_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
&_swigt__p_MeCab__Lattice,
&_swigt__p_MeCab__Model,
&_swigt__p_MeCab__Tagger,
&_swigt__p_char,
&_swigt__p_mecab_dictionary_info_t,
&_swigt__p_mecab_node_t,
&_swigt__p_mecab_path_t,
&_swigt__p_mecab_t,
&_swigt__p_p_char,
};
static swig_cast_info _swigc__p_MeCab__Lattice[] = { {&_swigt__p_MeCab__Lattice, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_MeCab__Model[] = { {&_swigt__p_MeCab__Model, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_MeCab__Tagger[] = { {&_swigt__p_MeCab__Tagger, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_mecab_dictionary_info_t[] = { {&_swigt__p_mecab_dictionary_info_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_mecab_node_t[] = { {&_swigt__p_mecab_node_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_mecab_path_t[] = { {&_swigt__p_mecab_path_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_mecab_t[] = { {&_swigt__p_mecab_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
_swigc__p_MeCab__Lattice,
_swigc__p_MeCab__Model,
_swigc__p_MeCab__Tagger,
_swigc__p_char,
_swigc__p_mecab_dictionary_info_t,
_swigc__p_mecab_node_t,
_swigc__p_mecab_path_t,
_swigc__p_mecab_t,
_swigc__p_p_char,
};
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
static swig_constant_info swig_constants[] = {
{0,0,0,0,0,0}
};
#ifdef __cplusplus
}
#endif
static swig_variable_info swig_variables[] = {
{0,0,0,0}
};
static swig_command_info swig_commands[] = {
{"MeCabc::DictionaryInfo_filename_get", _wrap_DictionaryInfo_filename_get},
{"MeCabc::DictionaryInfo_charset_get", _wrap_DictionaryInfo_charset_get},
{"MeCabc::DictionaryInfo_size_get", _wrap_DictionaryInfo_size_get},
{"MeCabc::DictionaryInfo_type_get", _wrap_DictionaryInfo_type_get},
{"MeCabc::DictionaryInfo_lsize_get", _wrap_DictionaryInfo_lsize_get},
{"MeCabc::DictionaryInfo_rsize_get", _wrap_DictionaryInfo_rsize_get},
{"MeCabc::DictionaryInfo_version_get", _wrap_DictionaryInfo_version_get},
{"MeCabc::DictionaryInfo_next_get", _wrap_DictionaryInfo_next_get},
{"MeCabc::new_DictionaryInfo", _wrap_new_DictionaryInfo},
{"MeCabc::delete_DictionaryInfo", _wrap_delete_DictionaryInfo},
{"MeCabc::Path_rnode_get", _wrap_Path_rnode_get},
{"MeCabc::Path_rnext_get", _wrap_Path_rnext_get},
{"MeCabc::Path_lnode_get", _wrap_Path_lnode_get},
{"MeCabc::Path_lnext_get", _wrap_Path_lnext_get},
{"MeCabc::Path_cost_get", _wrap_Path_cost_get},
{"MeCabc::Path_prob_set", _wrap_Path_prob_set},
{"MeCabc::Path_prob_get", _wrap_Path_prob_get},
{"MeCabc::Node_prev_get", _wrap_Node_prev_get},
{"MeCabc::Node_next_get", _wrap_Node_next_get},
{"MeCabc::Node_enext_get", _wrap_Node_enext_get},
{"MeCabc::Node_bnext_get", _wrap_Node_bnext_get},
{"MeCabc::Node_rpath_get", _wrap_Node_rpath_get},
{"MeCabc::Node_lpath_get", _wrap_Node_lpath_get},
{"MeCabc::Node_feature_get", _wrap_Node_feature_get},
{"MeCabc::Node_id_get", _wrap_Node_id_get},
{"MeCabc::Node_length_get", _wrap_Node_length_get},
{"MeCabc::Node_rlength_get", _wrap_Node_rlength_get},
{"MeCabc::Node_rcAttr_get", _wrap_Node_rcAttr_get},
{"MeCabc::Node_lcAttr_get", _wrap_Node_lcAttr_get},
{"MeCabc::Node_posid_get", _wrap_Node_posid_get},
{"MeCabc::Node_char_type_get", _wrap_Node_char_type_get},
{"MeCabc::Node_stat_get", _wrap_Node_stat_get},
{"MeCabc::Node_isbest_get", _wrap_Node_isbest_get},
{"MeCabc::Node_alpha_get", _wrap_Node_alpha_get},
{"MeCabc::Node_beta_get", _wrap_Node_beta_get},
{"MeCabc::Node_prob_set", _wrap_Node_prob_set},
{"MeCabc::Node_prob_get", _wrap_Node_prob_get},
{"MeCabc::Node_wcost_get", _wrap_Node_wcost_get},
{"MeCabc::Node_cost_get", _wrap_Node_cost_get},
{"MeCabc::Node_surface_get", _wrap_Node_surface_get},
{"MeCabc::Lattice_clear", _wrap_Lattice_clear},
{"MeCabc::Lattice_is_available", _wrap_Lattice_is_available},
{"MeCabc::Lattice_bos_node", _wrap_Lattice_bos_node},
{"MeCabc::Lattice_eos_node", _wrap_Lattice_eos_node},
{"MeCabc::Lattice_end_nodes", _wrap_Lattice_end_nodes},
{"MeCabc::Lattice_begin_nodes", _wrap_Lattice_begin_nodes},
{"MeCabc::Lattice_sentence", _wrap_Lattice_sentence},
{"MeCabc::Lattice_size", _wrap_Lattice_size},
{"MeCabc::Lattice_set_Z", _wrap_Lattice_set_Z},
{"MeCabc::Lattice_Z", _wrap_Lattice_Z},
{"MeCabc::Lattice_set_theta", _wrap_Lattice_set_theta},
{"MeCabc::Lattice_theta", _wrap_Lattice_theta},
{"MeCabc::Lattice_next", _wrap_Lattice_next},
{"MeCabc::Lattice_request_type", _wrap_Lattice_request_type},
{"MeCabc::Lattice_has_request_type", _wrap_Lattice_has_request_type},
{"MeCabc::Lattice_set_request_type", _wrap_Lattice_set_request_type},
{"MeCabc::Lattice_add_request_type", _wrap_Lattice_add_request_type},
{"MeCabc::Lattice_remove_request_type", _wrap_Lattice_remove_request_type},
{"MeCabc::Lattice_newNode", _wrap_Lattice_newNode},
{"MeCabc::Lattice_toString", _wrap_Lattice_toString},
{"MeCabc::Lattice_enumNBestAsString", _wrap_Lattice_enumNBestAsString},
{"MeCabc::Lattice_has_constraint", _wrap_Lattice_has_constraint},
{"MeCabc::Lattice_boundary_constraint", _wrap_Lattice_boundary_constraint},
{"MeCabc::Lattice_feature_constraint", _wrap_Lattice_feature_constraint},
{"MeCabc::Lattice_set_boundary_constraint", _wrap_Lattice_set_boundary_constraint},
{"MeCabc::Lattice_set_feature_constraint", _wrap_Lattice_set_feature_constraint},
{"MeCabc::Lattice_set_result", _wrap_Lattice_set_result},
{"MeCabc::Lattice_what", _wrap_Lattice_what},
{"MeCabc::Lattice_set_what", _wrap_Lattice_set_what},
{"MeCabc::delete_Lattice", _wrap_delete_Lattice},
{"MeCabc::new_Lattice", _wrap_new_Lattice},
{"MeCabc::Lattice_set_sentence", _wrap_Lattice_set_sentence},
{"MeCabc::Model_dictionary_info", _wrap_Model_dictionary_info},
{"MeCabc::Model_transition_cost", _wrap_Model_transition_cost},
{"MeCabc::Model_lookup", _wrap_Model_lookup},
{"MeCabc::Model_createTagger", _wrap_Model_createTagger},
{"MeCabc::Model_createLattice", _wrap_Model_createLattice},
{"MeCabc::Model_swap", _wrap_Model_swap},
{"MeCabc::Model_version", _wrap_Model_version},
{"MeCabc::delete_Model", _wrap_delete_Model},
{"MeCabc::Model_create", _wrap_Model_create},
{"MeCabc::new_Model", _wrap_new_Model},
{"MeCabc::Tagger_parse", _wrap_Tagger_parse},
{"MeCabc::Tagger_parseToNode", _wrap_Tagger_parseToNode},
{"MeCabc::Tagger_parseNBest", _wrap_Tagger_parseNBest},
{"MeCabc::Tagger_parseNBestInit", _wrap_Tagger_parseNBestInit},
{"MeCabc::Tagger_nextNode", _wrap_Tagger_nextNode},
{"MeCabc::Tagger_next", _wrap_Tagger_next},
{"MeCabc::Tagger_formatNode", _wrap_Tagger_formatNode},
{"MeCabc::Tagger_set_request_type", _wrap_Tagger_set_request_type},
{"MeCabc::Tagger_request_type", _wrap_Tagger_request_type},
{"MeCabc::Tagger_partial", _wrap_Tagger_partial},
{"MeCabc::Tagger_set_partial", _wrap_Tagger_set_partial},
{"MeCabc::Tagger_lattice_level", _wrap_Tagger_lattice_level},
{"MeCabc::Tagger_set_lattice_level", _wrap_Tagger_set_lattice_level},
{"MeCabc::Tagger_all_morphs", _wrap_Tagger_all_morphs},
{"MeCabc::Tagger_set_all_morphs", _wrap_Tagger_set_all_morphs},
{"MeCabc::Tagger_set_theta", _wrap_Tagger_set_theta},
{"MeCabc::Tagger_theta", _wrap_Tagger_theta},
{"MeCabc::Tagger_dictionary_info", _wrap_Tagger_dictionary_info},
{"MeCabc::Tagger_what", _wrap_Tagger_what},
{"MeCabc::delete_Tagger", _wrap_delete_Tagger},
{"MeCabc::Tagger_create", _wrap_Tagger_create},
{"MeCabc::Tagger_version", _wrap_Tagger_version},
{"MeCabc::new_Tagger", _wrap_new_Tagger},
{"MeCabc::Tagger_parseToString", _wrap_Tagger_parseToString},
{0,0}
};
/* -----------------------------------------------------------------------------
* Type initialization:
* This problem is tough by the requirement that no dynamic
* memory is used. Also, since swig_type_info structures store pointers to
* swig_cast_info structures and swig_cast_info structures store pointers back
* to swig_type_info structures, we need some lookup code at initialization.
* The idea is that swig generates all the structures that are needed.
* The runtime then collects these partially filled structures.
* The SWIG_InitializeModule function takes these initial arrays out of
* swig_module, and does all the lookup, filling in the swig_module.types
* array with the correct data and linking the correct swig_cast_info
* structures together.
*
* The generated swig_type_info structures are assigned staticly to an initial
* array. We just loop through that array, and handle each type individually.
* First we lookup if this type has been already loaded, and if so, use the
* loaded structure instead of the generated one. Then we have to fill in the
* cast linked list. The cast data is initially stored in something like a
* two-dimensional array. Each row corresponds to a type (there are the same
* number of rows as there are in the swig_type_initial array). Each entry in
* a column is one of the swig_cast_info structures for that type.
* The cast_initial array is actually an array of arrays, because each row has
* a variable number of columns. So to actually build the cast linked list,
* we find the array of casts associated with the type, and loop through it
* adding the casts to the list. The one last trick we need to do is making
* sure the type pointer in the swig_cast_info struct is correct.
*
* First off, we lookup the cast->type name to see if it is already loaded.
* There are three cases to handle:
* 1) If the cast->type has already been loaded AND the type we are adding
* casting info to has not been loaded (it is in this module), THEN we
* replace the cast->type pointer with the type pointer that has already
* been loaded.
* 2) If BOTH types (the one we are adding casting info to, and the
* cast->type) are loaded, THEN the cast info has already been loaded by
* the previous module so we just ignore it.
* 3) Finally, if cast->type has not already been loaded, then we add that
* swig_cast_info to the linked list (because the cast->type) pointer will
* be correct.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif
#if 0
#define SWIGRUNTIME_DEBUG
#endif
SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
size_t i;
swig_module_info *module_head, *iter;
int found, init;
clientdata = clientdata;
/* check to see if the circular list has been setup, if not, set it up */
if (swig_module.next==0) {
/* Initialize the swig_module */
swig_module.type_initial = swig_type_initial;
swig_module.cast_initial = swig_cast_initial;
swig_module.next = &swig_module;
init = 1;
} else {
init = 0;
}
/* Try and load any already created modules */
module_head = SWIG_GetModule(clientdata);
if (!module_head) {
/* This is the first module loaded for this interpreter */
/* so set the swig module into the interpreter */
SWIG_SetModule(clientdata, &swig_module);
module_head = &swig_module;
} else {
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
found=0;
iter=module_head;
do {
if (iter==&swig_module) {
found=1;
break;
}
iter=iter->next;
} while (iter!= module_head);
/* if the is found in the list, then all is done and we may leave */
if (found) return;
/* otherwise we must add out module into the list */
swig_module.next = module_head->next;
module_head->next = &swig_module;
}
/* When multiple interpeters are used, a module could have already been initialized in
a different interpreter, but not yet have a pointer in this interpreter.
In this case, we do not want to continue adding types... everything should be
set up already */
if (init == 0) return;
/* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
for (i = 0; i < swig_module.size; ++i) {
swig_type_info *type = 0;
swig_type_info *ret;
swig_cast_info *cast;
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif
/* if there is another module already loaded */
if (swig_module.next != &swig_module) {
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
}
if (type) {
/* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
if (swig_module.type_initial[i]->clientdata) {
type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
}
} else {
type = swig_module.type_initial[i];
}
/* Insert casting types */
cast = swig_module.cast_initial[i];
while (cast->type) {
/* Don't need to add information already in the list */
ret = 0;
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
if (swig_module.next != &swig_module) {
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
}
if (ret) {
if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
cast->type = ret;
ret = 0;
} else {
/* Check for casting already in the list */
swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
if (!ocast) ret = 0;
}
}
if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
if (type->cast) {
type->cast->prev = cast;
cast->next = type->cast;
}
type->cast = cast;
}
cast++;
}
/* Set entry in modules->types array equal to the type */
swig_module.types[i] = type;
}
swig_module.types[i] = 0;
#ifdef SWIGRUNTIME_DEBUG
printf("**** SWIG_InitializeModule: Cast List ******\n");
for (i = 0; i < swig_module.size; ++i) {
int j = 0;
swig_cast_info *cast = swig_module.cast_initial[i];
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
while (cast->type) {
printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
cast++;
++j;
}
printf("---- Total casts: %d\n",j);
}
printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}
/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types. It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
size_t i;
swig_cast_info *equiv;
static int init_run = 0;
if (init_run) return;
init_run = 1;
for (i = 0; i < swig_module.size; i++) {
if (swig_module.types[i]->clientdata) {
equiv = swig_module.types[i]->cast;
while (equiv) {
if (!equiv->converter) {
if (equiv->type && !equiv->type->clientdata)
SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
}
equiv = equiv->next;
}
}
}
}
#ifdef __cplusplus
#if 0
{
/* c-mode */
#endif
}
#endif
#ifdef __cplusplus
extern "C"
#endif
XS(SWIG_init) {
dXSARGS;
int i;
SWIG_InitializeModule(0);
/* Install commands */
for (i = 0; swig_commands[i].name; i++) {
newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
}
/* Install variables */
for (i = 0; swig_variables[i].name; i++) {
SV *sv;
sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
if (swig_variables[i].type) {
SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
} else {
sv_setiv(sv,(IV) 0);
}
swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
}
/* Install constant */
for (i = 0; swig_constants[i].type; i++) {
SV *sv;
sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
switch(swig_constants[i].type) {
case SWIG_INT:
sv_setiv(sv, (IV) swig_constants[i].lvalue);
break;
case SWIG_FLOAT:
sv_setnv(sv, (double) swig_constants[i].dvalue);
break;
case SWIG_STRING:
sv_setpv(sv, (char *) swig_constants[i].pvalue);
break;
case SWIG_POINTER:
SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
break;
case SWIG_BINARY:
SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
break;
default:
break;
}
SvREADONLY_on(sv);
}
SWIG_TypeClientData(SWIGTYPE_p_mecab_dictionary_info_t, (void*) "MeCab::DictionaryInfo");
SWIG_TypeClientData(SWIGTYPE_p_mecab_path_t, (void*) "MeCab::Path");
SWIG_TypeClientData(SWIGTYPE_p_mecab_node_t, (void*) "MeCab::Node");
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_NOR_NODE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_NOR_NODE)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_UNK_NODE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_UNK_NODE)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_BOS_NODE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_BOS_NODE)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_EOS_NODE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_EOS_NODE)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_EON_NODE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_EON_NODE)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_SYS_DIC", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_SYS_DIC)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_USR_DIC", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_USR_DIC)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_UNK_DIC", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_UNK_DIC)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_ONE_BEST", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ONE_BEST)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_NBEST", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_NBEST)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_PARTIAL", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_PARTIAL)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_MARGINAL_PROB", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_MARGINAL_PROB)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_ALTERNATIVE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ALTERNATIVE)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_ALL_MORPHS", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ALL_MORPHS)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_ALLOCATE_SENTENCE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ALLOCATE_SENTENCE)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_ANY_BOUNDARY", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_ANY_BOUNDARY)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_TOKEN_BOUNDARY", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_TOKEN_BOUNDARY)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MECAB_INSIDE_TOKEN", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MECAB_INSIDE_TOKEN)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
SWIG_TypeClientData(SWIGTYPE_p_MeCab__Lattice, (void*) "MeCab::Lattice");
SWIG_TypeClientData(SWIGTYPE_p_MeCab__Model, (void*) "MeCab::Model");
SWIG_TypeClientData(SWIGTYPE_p_MeCab__Tagger, (void*) "MeCab::Tagger");
/*@SWIG:/usr/share/swig2.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "VERSION", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_FromCharPtr("0.996"));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
ST(0) = &PL_sv_yes;
XSRETURN(1);
}
mecab-perl-0.996/AUTHORS 0000644 0025620 0011610 00000000034 12110211100 013065 0 ustar taku eng Taku Kudo
mecab-perl-0.996/Makefile.PL 0000644 0025620 0011610 00000000551 12110211100 013773 0 ustar taku eng use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'MeCab',
'CC' => `mecab-config --cxx`,
'LD' => `mecab-config --cxx`,
'INC' => `mecab-config --cflags`,
'LIBS' => `mecab-config --libs`,
'VERSION' => `mecab-config --version`,
'OBJECT' => 'MeCab_wrap.o'
);
mecab-perl-0.996/bindings.html 0000644 0025620 0011610 00000022401 12110211100 014502 0 ustar taku eng
スクリプト言語のバインディング
スクリプト言語のバインディング
概要
各種スクリプト言語
(perl ,
ruby ,
python ,
Java )
から, MeCab が提供する形態素解析の機能を利用可能です.
各バインディングは SWIG というプログラ
ムを用いて, 自動生成されています. SWIG がサポートする他の言語も
生成可能だと思われますが, 現在は, 作者の管理できる範囲内ということで,
上記の4つの言語のみを提供しております.
インストール
各言語バイディングのインストール方法は, perl/README, ruby/README, python/README,
java/README を御覧下さい.
とりあえず解析する
MeCab::Tagger というクラスのインスタンスを生成し, parse (もしくは
parseToString) というメソッドを呼ぶことで, 解析結果が文字列として取得できます.
MeCab::Tagger のコンストラクタの引数は, 基本的に mecab の実行形式に与え
るパラメータと同一で, それらを文字列として与えます.
perl
use MeCab;
$m = new MeCab::Tagger ("-Ochasen");
print $m->parse ("今日もしないとね");
ruby
require 'MeCab'
m = MeCab::Tagger.new ("-Ochasen")
print m.parse ("今日もしないとね")
python
import sys
import MeCab
m = MeCab.Tagger ("-Ochasen")
print m.parse ("今日もしないとね")
Java
import org.chasen.mecab.Tagger;
import org.chasen.mecab.Node
public static void main(String[] argv) {
Tagger tagger = new Tagger ("-Ochasen");
System.out.println (tagger.parse ("太郎は二郎にこの本を渡した."));
}
各形態素の詳細情報を取得する
MeCab::Tagger クラスの, parseToNode という
メソッドを呼ぶことで, 「文頭」という特別な形態素が MeCab::Node クラスのインスタンスとして
取得できます.
MeCab::Node は, 双方向リストとして表現されており, next, prev というメン
バ変数があります. それぞれ, 次の形態素, 前の形態素を MeCab::Node クラスのインスタンスとして
返します. 全形態素には, next を順次呼ぶことでアクセスできます.
MeCab::Node は C 言語のインタフェイスで提供している mecab_node_t をラッ
プしたクラスです. mecab_node_t が持つほぼすべてのメンバ変数にアクセスす
ることができます. ただし, surface のみ, 単語そのものが返るように変更して
います.
以下に perl の例を示します. この例では,
各形態素を順次にアクセスし,形態素の表層文字列, 品詞, その形態素までのコストを表示します.
use MeCab;
my $m = new MeCab::Tagger ("");
for (my $n = $m->parseToNode ("今日もしないとね"); $n ; $n = $n->{next}) {
printf ("%s\t%s\t%d\n",
$n->{surface}, # 表層
$n->{feature}, # 現在の品詞
$n->{cost} # その形態素までのコスト
);
}
エラー処理
もし, コンストラクタや, 解析途中でエラーが起きた場合は,
RuntimeError 例外が発生します.
例外のハンドリングの方法は, 各言語のリファレンスマニュアルを
ごらんください. 以下は, python の例です
try:
m = MeCab.Tagger ("-d .")
print m.parse ("今日もしないとね")
except RuntimeError, e:
print "RuntimeError:", e;
注意事項
文頭,文末形態素
parseToNode の返り値は, 「文頭」という特別な形態素を示す MeCab::Node
インタンスです. さらに, 「文末」という特別な形態素も存在いたしますので,
注意してください. もし, これらを無視したい場合は, 以下のように
next でそれぞれを読み飛ばしてください.
my $n = $m->parseToNode ("今日もしないとね");
$n = $n->{next}; # 「文頭」を無視
while ($n->{next}) { # next を調べる
printf ("%s\n", $n->{surface});
$n = $n->{next}; # 次に移動
}
MeCab::Node の振舞い
MeCab::Node の実体(メモリ上にある形態素情報)は,
MeCab::Tagger インスタンスが管理しています. MeCab::Node は,
Node の実体を指している参照 にすぎせん. そのために, parseToNode が
呼ばれる度に, 実体そのものが, 上書きされていきます. 以下のような例はソースの意図する通りには動きません.
m = MeCab.Tagger ("")
n1 = m.parseToNode ("今日もしないとね")
n2 = m.parseToNode ("さくさくさくら")
# n1 の内容は無効になっている
while (n1.hasNode () != 0):
print n1.getSurface ()
n1 = n1.next ()
上記の例では, n1 の指す中身が, 「さくさくさくら」を解析した時点で
上書きされており, 使用できなくなっています.
複数の Node を同時にアクセスしたい場合は, 複数の MeCab::Tagger インスタンスを生成してください.
全メソッド
以下に, SWIG 用のインタフェースファイル
の一部を示します. バイディングの実装言語の都合上, C++ のシンタックスで
表記されていますが, 適宜読みかえてください. また, 各メソッドの動作も添え
ていますので参考にしてください.
namespace MeCab {
class Tagger {
// str を解析して文字列として結果を得ます. len は str の長さ(省略可能)
string parse(string str, int len);
// parse と同じ
string parseToString(string str, int len);
// str を解析して MeCab::Node 型の形態素を返します.
// この形態素は文頭を示すもので, next を順に辿ることで全形態素にアクセスできます
Node parseToNode(string str, int len);
// parse の Nbest 版です. N に nbest の個数を指定します.
// この機能を使う場合は, 起動時オプションとして -l 1 を指定する必要があります
string parseNBest(int N, string str, int len);
// 解析結果を, 確からしいものから順番に取得する場合にこの関数で初期化を行います.
bool parseNBestInit(string str, int len);
// parseNbestInit() の後, この関数を順次呼ぶことで, 確からしい解析結果を, 順番に取得できます.
string next();
// next() と同じですが, MeCab::Node を返します.
Node nextNode();
};
#define MECAB_NOR_NODE 0
#define MECAB_UNK_NODE 1
#define MECAB_BOS_NODE 2
#define MECAB_EOS_NODE 3
struct Node {
struct Node prev; // 一つ前の形態素へのポインタ
struct Node next; // 一つ先の形態素へのポインタ
struct Node enext; // 同じ位置で終わる形態素へのポインタ
struct Node bnext; // 同じ開始位置で始まる形態素へのポインタ
string surface; // 形態素の文字列情報
string feature; // CSV で表記された素性情報
unsigned int length; // 形態素の長さ
unsigned int rlength; // 形態素の長さ(先頭のスペースを含む)
unsigned int id; // 形態素に付与される ユニークID
unsigned short rcAttr; // 右文脈 id
unsigned short lcAttr; // 左文脈 id
unsigned short posid; // 形態素 ID (未使用)
unsigned char char_type; // 文字種情報
unsigned char stat; // 形態素の種類: 以下のマクロの値
// #define MECAB_NOR_NODE 0
// #define MECAB_UNK_NODE 1
// #define MECAB_BOS_NODE 2
// #define MECAB_EOS_NODE 3
unsigned char isbest; // ベスト解の場合 1, それ以外 0
float alpha; // forward backward の foward log 確率
float beta; // forward backward の backward log 確率
float prob; // 周辺確率
// alpha, beta, prob は -l 2 オプションを指定した時に定義されます
short wcost; // 単語生起コスト
long cost; // 累積コスト
};
}
サンプルプログラム
perl/test.pl, ruby/test.rb, python/test.py, java/test.java
にそれぞれの言語のサンプルがありますので, 参考にしてください.
mecab-perl-0.996/GPL 0000644 0025620 0011610 00000043131 12110211100 012367 0 ustar taku eng GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
mecab-perl-0.996/BSD 0000644 0025620 0011610 00000003102 12110211100 012347 0 ustar taku eng Copyright (c) 2001-2008, Taku Kudo
Copyright (c) 2004-2008, Nippon Telegraph and Telephone Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* 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.
* Neither the name of the Nippon Telegraph and Telegraph Corporation
nor the names of its contributors may be used to endorse or
promote products derived from this software without specific
prior written permission.
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 OWNER 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.
mecab-perl-0.996/MANIFEST 0000644 0025620 0011610 00000000063 12110211100 013150 0 ustar taku eng Makefile.PL
MeCab.pm
MeCab_wrap.cxx
README
test.pl
mecab-perl-0.996/MeCab.pm 0000644 0025620 0011610 00000026074 12110211100 013336 0 ustar taku eng # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
package MeCab;
use base qw(Exporter);
use base qw(DynaLoader);
package MeCabc;
bootstrap MeCab;
package MeCab;
@EXPORT = qw();
# ---------- BASE METHODS -------------
package MeCab;
sub TIEHASH {
my ($classname,$obj) = @_;
return bless $obj, $classname;
}
sub CLEAR { }
sub FIRSTKEY { }
sub NEXTKEY { }
sub FETCH {
my ($self,$field) = @_;
my $member_func = "swig_${field}_get";
$self->$member_func();
}
sub STORE {
my ($self,$field,$newval) = @_;
my $member_func = "swig_${field}_set";
$self->$member_func($newval);
}
sub this {
my $ptr = shift;
return tied(%$ptr);
}
# ------- FUNCTION WRAPPERS --------
package MeCab;
############# Class : MeCab::DictionaryInfo ##############
package MeCab::DictionaryInfo;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( MeCab );
%OWNER = ();
%ITERATORS = ();
*swig_filename_get = *MeCabc::DictionaryInfo_filename_get;
*swig_filename_set = *MeCabc::DictionaryInfo_filename_set;
*swig_charset_get = *MeCabc::DictionaryInfo_charset_get;
*swig_charset_set = *MeCabc::DictionaryInfo_charset_set;
*swig_size_get = *MeCabc::DictionaryInfo_size_get;
*swig_size_set = *MeCabc::DictionaryInfo_size_set;
*swig_type_get = *MeCabc::DictionaryInfo_type_get;
*swig_type_set = *MeCabc::DictionaryInfo_type_set;
*swig_lsize_get = *MeCabc::DictionaryInfo_lsize_get;
*swig_lsize_set = *MeCabc::DictionaryInfo_lsize_set;
*swig_rsize_get = *MeCabc::DictionaryInfo_rsize_get;
*swig_rsize_set = *MeCabc::DictionaryInfo_rsize_set;
*swig_version_get = *MeCabc::DictionaryInfo_version_get;
*swig_version_set = *MeCabc::DictionaryInfo_version_set;
*swig_next_get = *MeCabc::DictionaryInfo_next_get;
*swig_next_set = *MeCabc::DictionaryInfo_next_set;
sub new {
my $pkg = shift;
my $self = MeCabc::new_DictionaryInfo(@_);
bless $self, $pkg if defined($self);
}
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
MeCabc::delete_DictionaryInfo($self);
delete $OWNER{$self};
}
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : MeCab::Path ##############
package MeCab::Path;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( MeCab );
%OWNER = ();
%ITERATORS = ();
*swig_rnode_get = *MeCabc::Path_rnode_get;
*swig_rnode_set = *MeCabc::Path_rnode_set;
*swig_rnext_get = *MeCabc::Path_rnext_get;
*swig_rnext_set = *MeCabc::Path_rnext_set;
*swig_lnode_get = *MeCabc::Path_lnode_get;
*swig_lnode_set = *MeCabc::Path_lnode_set;
*swig_lnext_get = *MeCabc::Path_lnext_get;
*swig_lnext_set = *MeCabc::Path_lnext_set;
*swig_cost_get = *MeCabc::Path_cost_get;
*swig_cost_set = *MeCabc::Path_cost_set;
*swig_prob_get = *MeCabc::Path_prob_get;
*swig_prob_set = *MeCabc::Path_prob_set;
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : MeCab::Node ##############
package MeCab::Node;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( MeCab );
%OWNER = ();
%ITERATORS = ();
*swig_prev_get = *MeCabc::Node_prev_get;
*swig_prev_set = *MeCabc::Node_prev_set;
*swig_next_get = *MeCabc::Node_next_get;
*swig_next_set = *MeCabc::Node_next_set;
*swig_enext_get = *MeCabc::Node_enext_get;
*swig_enext_set = *MeCabc::Node_enext_set;
*swig_bnext_get = *MeCabc::Node_bnext_get;
*swig_bnext_set = *MeCabc::Node_bnext_set;
*swig_rpath_get = *MeCabc::Node_rpath_get;
*swig_rpath_set = *MeCabc::Node_rpath_set;
*swig_lpath_get = *MeCabc::Node_lpath_get;
*swig_lpath_set = *MeCabc::Node_lpath_set;
*swig_feature_get = *MeCabc::Node_feature_get;
*swig_feature_set = *MeCabc::Node_feature_set;
*swig_id_get = *MeCabc::Node_id_get;
*swig_id_set = *MeCabc::Node_id_set;
*swig_length_get = *MeCabc::Node_length_get;
*swig_length_set = *MeCabc::Node_length_set;
*swig_rlength_get = *MeCabc::Node_rlength_get;
*swig_rlength_set = *MeCabc::Node_rlength_set;
*swig_rcAttr_get = *MeCabc::Node_rcAttr_get;
*swig_rcAttr_set = *MeCabc::Node_rcAttr_set;
*swig_lcAttr_get = *MeCabc::Node_lcAttr_get;
*swig_lcAttr_set = *MeCabc::Node_lcAttr_set;
*swig_posid_get = *MeCabc::Node_posid_get;
*swig_posid_set = *MeCabc::Node_posid_set;
*swig_char_type_get = *MeCabc::Node_char_type_get;
*swig_char_type_set = *MeCabc::Node_char_type_set;
*swig_stat_get = *MeCabc::Node_stat_get;
*swig_stat_set = *MeCabc::Node_stat_set;
*swig_isbest_get = *MeCabc::Node_isbest_get;
*swig_isbest_set = *MeCabc::Node_isbest_set;
*swig_alpha_get = *MeCabc::Node_alpha_get;
*swig_alpha_set = *MeCabc::Node_alpha_set;
*swig_beta_get = *MeCabc::Node_beta_get;
*swig_beta_set = *MeCabc::Node_beta_set;
*swig_prob_get = *MeCabc::Node_prob_get;
*swig_prob_set = *MeCabc::Node_prob_set;
*swig_wcost_get = *MeCabc::Node_wcost_get;
*swig_wcost_set = *MeCabc::Node_wcost_set;
*swig_cost_get = *MeCabc::Node_cost_get;
*swig_cost_set = *MeCabc::Node_cost_set;
*swig_surface_get = *MeCabc::Node_surface_get;
*swig_surface_set = *MeCabc::Node_surface_set;
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : MeCab::Lattice ##############
package MeCab::Lattice;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( MeCab );
%OWNER = ();
%ITERATORS = ();
*clear = *MeCabc::Lattice_clear;
*is_available = *MeCabc::Lattice_is_available;
*bos_node = *MeCabc::Lattice_bos_node;
*eos_node = *MeCabc::Lattice_eos_node;
*end_nodes = *MeCabc::Lattice_end_nodes;
*begin_nodes = *MeCabc::Lattice_begin_nodes;
*sentence = *MeCabc::Lattice_sentence;
*size = *MeCabc::Lattice_size;
*set_Z = *MeCabc::Lattice_set_Z;
*Z = *MeCabc::Lattice_Z;
*set_theta = *MeCabc::Lattice_set_theta;
*theta = *MeCabc::Lattice_theta;
*next = *MeCabc::Lattice_next;
*request_type = *MeCabc::Lattice_request_type;
*has_request_type = *MeCabc::Lattice_has_request_type;
*set_request_type = *MeCabc::Lattice_set_request_type;
*add_request_type = *MeCabc::Lattice_add_request_type;
*remove_request_type = *MeCabc::Lattice_remove_request_type;
*newNode = *MeCabc::Lattice_newNode;
*toString = *MeCabc::Lattice_toString;
*enumNBestAsString = *MeCabc::Lattice_enumNBestAsString;
*has_constraint = *MeCabc::Lattice_has_constraint;
*boundary_constraint = *MeCabc::Lattice_boundary_constraint;
*feature_constraint = *MeCabc::Lattice_feature_constraint;
*set_boundary_constraint = *MeCabc::Lattice_set_boundary_constraint;
*set_feature_constraint = *MeCabc::Lattice_set_feature_constraint;
*set_result = *MeCabc::Lattice_set_result;
*what = *MeCabc::Lattice_what;
*set_what = *MeCabc::Lattice_set_what;
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
MeCabc::delete_Lattice($self);
delete $OWNER{$self};
}
}
sub new {
my $pkg = shift;
my $self = MeCabc::new_Lattice(@_);
bless $self, $pkg if defined($self);
}
*set_sentence = *MeCabc::Lattice_set_sentence;
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : MeCab::Model ##############
package MeCab::Model;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( MeCab );
%OWNER = ();
%ITERATORS = ();
*dictionary_info = *MeCabc::Model_dictionary_info;
*transition_cost = *MeCabc::Model_transition_cost;
*lookup = *MeCabc::Model_lookup;
*createTagger = *MeCabc::Model_createTagger;
*createLattice = *MeCabc::Model_createLattice;
*swap = *MeCabc::Model_swap;
*version = *MeCabc::Model_version;
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
MeCabc::delete_Model($self);
delete $OWNER{$self};
}
}
*create = *MeCabc::Model_create;
sub new {
my $pkg = shift;
my $self = MeCabc::new_Model(@_);
bless $self, $pkg if defined($self);
}
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
############# Class : MeCab::Tagger ##############
package MeCab::Tagger;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( MeCab );
%OWNER = ();
%ITERATORS = ();
*parse = *MeCabc::Tagger_parse;
*parseToNode = *MeCabc::Tagger_parseToNode;
*parseNBest = *MeCabc::Tagger_parseNBest;
*parseNBestInit = *MeCabc::Tagger_parseNBestInit;
*nextNode = *MeCabc::Tagger_nextNode;
*next = *MeCabc::Tagger_next;
*formatNode = *MeCabc::Tagger_formatNode;
*set_request_type = *MeCabc::Tagger_set_request_type;
*request_type = *MeCabc::Tagger_request_type;
*partial = *MeCabc::Tagger_partial;
*set_partial = *MeCabc::Tagger_set_partial;
*lattice_level = *MeCabc::Tagger_lattice_level;
*set_lattice_level = *MeCabc::Tagger_set_lattice_level;
*all_morphs = *MeCabc::Tagger_all_morphs;
*set_all_morphs = *MeCabc::Tagger_set_all_morphs;
*set_theta = *MeCabc::Tagger_set_theta;
*theta = *MeCabc::Tagger_theta;
*dictionary_info = *MeCabc::Tagger_dictionary_info;
*what = *MeCabc::Tagger_what;
sub DESTROY {
return unless $_[0]->isa('HASH');
my $self = tied(%{$_[0]});
return unless defined $self;
delete $ITERATORS{$self};
if (exists $OWNER{$self}) {
MeCabc::delete_Tagger($self);
delete $OWNER{$self};
}
}
*create = *MeCabc::Tagger_create;
*version = *MeCabc::Tagger_version;
sub new {
my $pkg = shift;
my $self = MeCabc::new_Tagger(@_);
bless $self, $pkg if defined($self);
}
*parseToString = *MeCabc::Tagger_parseToString;
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
delete $OWNER{$ptr};
}
sub ACQUIRE {
my $self = shift;
my $ptr = tied(%$self);
$OWNER{$ptr} = 1;
}
# ------- VARIABLE STUBS --------
package MeCab;
*MECAB_NOR_NODE = *MeCabc::MECAB_NOR_NODE;
*MECAB_UNK_NODE = *MeCabc::MECAB_UNK_NODE;
*MECAB_BOS_NODE = *MeCabc::MECAB_BOS_NODE;
*MECAB_EOS_NODE = *MeCabc::MECAB_EOS_NODE;
*MECAB_EON_NODE = *MeCabc::MECAB_EON_NODE;
*MECAB_SYS_DIC = *MeCabc::MECAB_SYS_DIC;
*MECAB_USR_DIC = *MeCabc::MECAB_USR_DIC;
*MECAB_UNK_DIC = *MeCabc::MECAB_UNK_DIC;
*MECAB_ONE_BEST = *MeCabc::MECAB_ONE_BEST;
*MECAB_NBEST = *MeCabc::MECAB_NBEST;
*MECAB_PARTIAL = *MeCabc::MECAB_PARTIAL;
*MECAB_MARGINAL_PROB = *MeCabc::MECAB_MARGINAL_PROB;
*MECAB_ALTERNATIVE = *MeCabc::MECAB_ALTERNATIVE;
*MECAB_ALL_MORPHS = *MeCabc::MECAB_ALL_MORPHS;
*MECAB_ALLOCATE_SENTENCE = *MeCabc::MECAB_ALLOCATE_SENTENCE;
*MECAB_ANY_BOUNDARY = *MeCabc::MECAB_ANY_BOUNDARY;
*MECAB_TOKEN_BOUNDARY = *MeCabc::MECAB_TOKEN_BOUNDARY;
*MECAB_INSIDE_TOKEN = *MeCabc::MECAB_INSIDE_TOKEN;
*VERSION = *MeCabc::VERSION;
1;