mecab-java-0.996/0000755002562000116100000000000012110211100011777 5ustar takuengmecab-java-0.996/LGPL0000644002562000116100000006347412110211100012476 0ustar takueng 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-java-0.996/test.java0000644002562000116100000000320212110211100013616 0ustar takuengimport org.chasen.mecab.MeCab; import org.chasen.mecab.Tagger; import org.chasen.mecab.Model; import org.chasen.mecab.Lattice; import org.chasen.mecab.Node; public class test { static { try { System.loadLibrary("MeCab"); } catch (UnsatisfiedLinkError e) { System.err.println("Cannot load the example native code.\nMake sure your LD_LIBRARY_PATH contains \'.\'\n" + e); System.exit(1); } } public static void main(String[] argv) { System.out.println(MeCab.VERSION); Tagger tagger = new Tagger(); String str = "太郎は二郎にこの本を渡した。"; System.out.println(tagger.parse(str)); Node node = tagger.parseToNode(str); for (;node != null; node = node.getNext()) { System.out.println(node.getSurface() + "\t" + node.getFeature()); } System.out.println ("EOS\n"); Model model = new Model(); Tagger tagger2 = model.createTagger(); System.out.println (tagger2.parse(str)); Lattice lattice = model.createLattice(); System.out.println(str); lattice.set_sentence(str); if (tagger2.parse(lattice)) { System.out.println(lattice.toString()); for (node = lattice.bos_node(); node != null; node = node.getNext()) { System.out.println(node.getSurface() + "\t" + node.getFeature()); } System.out.println("EOS\n"); } lattice.add_request_type(MeCab.MECAB_NBEST); lattice.set_sentence(str); tagger2.parse(lattice); for (int i = 0; i < 10; ++i) { if (lattice.next()) { System.out.println("nbest:" + i + "\n" + lattice.toString()); } } } } mecab-java-0.996/README0000644002562000116100000000030512110211100012655 0ustar takuengMeCab java module $Id: README,v 1.2 2005/12/25 16:55:43 taku-ku Exp $; 1. Build UTF-8 dictionary 2. How to use? See test.java as sample program. % java -classpath MeCab.jar test -d ../dic mecab-java-0.996/COPYING0000644002562000116100000000036012110211100013031 0ustar takuengMeCab 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-java-0.996/MeCab_wrap.cxx0000644002562000116100000026165212110211100014537 0ustar takueng/* ---------------------------------------------------------------------------- * 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 SWIGJAVA #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 /* Fix for jlong on some versions of gcc on Windows */ #if defined(__GNUC__) && !defined(__INTEL_COMPILER) typedef long long __int64; #endif /* Fix for jlong on 64-bit x86 Solaris */ #if defined(__x86_64) # ifdef _LP64 # undef _LP64 # endif #endif #include #include #include /* Support for throwing Java exceptions */ typedef enum { SWIG_JavaOutOfMemoryError = 1, SWIG_JavaIOException, SWIG_JavaRuntimeException, SWIG_JavaIndexOutOfBoundsException, SWIG_JavaArithmeticException, SWIG_JavaIllegalArgumentException, SWIG_JavaNullPointerException, SWIG_JavaDirectorPureVirtual, SWIG_JavaUnknownError } SWIG_JavaExceptionCodes; typedef struct { SWIG_JavaExceptionCodes code; const char *java_exception; } SWIG_JavaExceptions_t; static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { jclass excep; static const SWIG_JavaExceptions_t java_exceptions[] = { { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, { SWIG_JavaIOException, "java/io/IOException" }, { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, { SWIG_JavaUnknownError, "java/lang/UnknownError" }, { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } }; const SWIG_JavaExceptions_t *except_ptr = java_exceptions; while (except_ptr->code != code && except_ptr->code) except_ptr++; jenv->ExceptionClear(); excep = jenv->FindClass(except_ptr->java_exception); if (excep) jenv->ThrowNew(excep, msg); } /* Contract support */ #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else /* Errors in SWIG */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 #define SWIG_IndexError -4 #define SWIG_TypeError -5 #define SWIG_DivisionByZero -6 #define SWIG_OverflowError -7 #define SWIG_SyntaxError -8 #define SWIG_ValueError -9 #define SWIG_SystemError -10 #define SWIG_AttributeError -11 #define SWIG_MemoryError -12 #define SWIG_NullReferenceError -13 SWIGINTERN void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) { SWIG_JavaExceptionCodes exception_code = SWIG_JavaUnknownError; switch(code) { case SWIG_MemoryError: exception_code = SWIG_JavaOutOfMemoryError; break; case SWIG_IOError: exception_code = SWIG_JavaIOException; break; case SWIG_SystemError: case SWIG_RuntimeError: exception_code = SWIG_JavaRuntimeException; break; case SWIG_OverflowError: case SWIG_IndexError: exception_code = SWIG_JavaIndexOutOfBoundsException; break; case SWIG_DivisionByZero: exception_code = SWIG_JavaArithmeticException; break; case SWIG_SyntaxError: case SWIG_ValueError: case SWIG_TypeError: exception_code = SWIG_JavaIllegalArgumentException; break; case SWIG_UnknownError: default: exception_code = SWIG_JavaUnknownError; break; } SWIG_JavaThrowException(jenv, exception_code, msg); } #include #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; } SWIGINTERN void MeCab_Lattice_set_sentence(MeCab::Lattice *self,char const *sentence){ self->add_request_type(MECAB_ALLOCATE_SENTENCE); self->set_sentence(sentence); } 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 SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1filename_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (char *) ((arg1)->filename); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1charset_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (char *) ((arg1)->charset); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1size_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (unsigned int) ((arg1)->size); jresult = (jlong)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1type_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (int) ((arg1)->type); jresult = (jint)result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1lsize_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (unsigned int) ((arg1)->lsize); jresult = (jlong)result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1rsize_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (unsigned int) ((arg1)->rsize); jresult = (jlong)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1version_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; unsigned short result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (unsigned short) ((arg1)->version); jresult = (jint)result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_DictionaryInfo_1next_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; mecab_dictionary_info_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_dictionary_info_t **)&jarg1; result = (mecab_dictionary_info_t *) ((arg1)->next); *(mecab_dictionary_info_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_new_1DictionaryInfo(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; mecab_dictionary_info_t *result = 0 ; (void)jenv; (void)jcls; { try { result = (mecab_dictionary_info_t *)new mecab_dictionary_info_t(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(mecab_dictionary_info_t **)&jresult = result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_delete_1DictionaryInfo(JNIEnv *jenv, jclass jcls, jlong jarg1) { mecab_dictionary_info_t *arg1 = (mecab_dictionary_info_t *) 0 ; (void)jenv; (void)jcls; arg1 = *(mecab_dictionary_info_t **)&jarg1; { try { delete arg1; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Path_1rnode_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_node_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_path_t **)&jarg1; result = (mecab_node_t *) ((arg1)->rnode); *(mecab_node_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Path_1rnext_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_path_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_path_t **)&jarg1; result = (mecab_path_t *) ((arg1)->rnext); *(mecab_path_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Path_1lnode_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_node_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_path_t **)&jarg1; result = (mecab_node_t *) ((arg1)->lnode); *(mecab_node_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Path_1lnext_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; mecab_path_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_path_t **)&jarg1; result = (mecab_path_t *) ((arg1)->lnext); *(mecab_path_t **)&jresult = result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Path_1cost_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_path_t **)&jarg1; result = (int) ((arg1)->cost); jresult = (jint)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Path_1prob_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jfloat jarg2) { mecab_path_t *arg1 = (mecab_path_t *) 0 ; float arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_path_t **)&jarg1; arg2 = (float)jarg2; if (arg1) (arg1)->prob = arg2; } SWIGEXPORT jfloat JNICALL Java_org_chasen_mecab_MeCabJNI_Path_1prob_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jfloat jresult = 0 ; mecab_path_t *arg1 = (mecab_path_t *) 0 ; float result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_path_t **)&jarg1; result = (float) ((arg1)->prob); jresult = (jfloat)result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1prev_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (mecab_node_t *) ((arg1)->prev); *(mecab_node_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1next_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (mecab_node_t *) ((arg1)->next); *(mecab_node_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1enext_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (mecab_node_t *) ((arg1)->enext); *(mecab_node_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1bnext_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_node_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (mecab_node_t *) ((arg1)->bnext); *(mecab_node_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1rpath_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_path_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (mecab_path_t *) ((arg1)->rpath); *(mecab_path_t **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1lpath_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; mecab_path_t *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (mecab_path_t *) ((arg1)->lpath); *(mecab_path_t **)&jresult = result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1feature_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (char *) ((arg1)->feature); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1id_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned int) ((arg1)->id); jresult = (jlong)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1length_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned short) ((arg1)->length); jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1rlength_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned short) ((arg1)->rlength); jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1rcAttr_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned short) ((arg1)->rcAttr); jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1lcAttr_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned short) ((arg1)->lcAttr); jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1posid_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned short result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned short) ((arg1)->posid); jresult = (jint)result; return jresult; } SWIGEXPORT jshort JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1char_1type_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jshort jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned char result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned char) ((arg1)->char_type); jresult = (jshort)result; return jresult; } SWIGEXPORT jshort JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1stat_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jshort jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned char result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned char) ((arg1)->stat); jresult = (jshort)result; return jresult; } SWIGEXPORT jshort JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1isbest_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jshort jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; unsigned char result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (unsigned char) ((arg1)->isbest); jresult = (jshort)result; return jresult; } SWIGEXPORT jfloat JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1alpha_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jfloat jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; float result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (float) ((arg1)->alpha); jresult = (jfloat)result; return jresult; } SWIGEXPORT jfloat JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1beta_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jfloat jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; float result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (float) ((arg1)->beta); jresult = (jfloat)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1prob_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jfloat jarg2) { mecab_node_t *arg1 = (mecab_node_t *) 0 ; float arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; arg2 = (float)jarg2; if (arg1) (arg1)->prob = arg2; } SWIGEXPORT jfloat JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1prob_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jfloat jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; float result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (float) ((arg1)->prob); jresult = (jfloat)result; return jresult; } SWIGEXPORT jshort JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1wcost_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jshort jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; short result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (short) ((arg1)->wcost); jresult = (jshort)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1cost_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; long result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; result = (long) ((arg1)->cost); jresult = (jint)result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Node_1surface_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; mecab_node_t *arg1 = (mecab_node_t *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(mecab_node_t **)&jarg1; { try { result = (char *)mecab_node_t_surface_get(arg1); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); delete [] result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1NOR_1NODE_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_NOR_NODE; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1UNK_1NODE_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_UNK_NODE; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1BOS_1NODE_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_BOS_NODE; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1EOS_1NODE_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_EOS_NODE; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1EON_1NODE_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_EON_NODE; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1SYS_1DIC_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_SYS_DIC; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1USR_1DIC_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_USR_DIC; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1UNK_1DIC_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_UNK_DIC; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1ONE_1BEST_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_ONE_BEST; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1NBEST_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_NBEST; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1PARTIAL_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_PARTIAL; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1MARGINAL_1PROB_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_MARGINAL_PROB; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1ALTERNATIVE_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_ALTERNATIVE; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1ALL_1MORPHS_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_ALL_MORPHS; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1ALLOCATE_1SENTENCE_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_ALLOCATE_SENTENCE; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1ANY_1BOUNDARY_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_ANY_BOUNDARY; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1TOKEN_1BOUNDARY_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_TOKEN_BOUNDARY; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_MECAB_1INSIDE_1TOKEN_1get(JNIEnv *jenv, jclass jcls) { jint jresult = 0 ; int result; (void)jenv; (void)jcls; { try { result = (int)MECAB_INSIDE_TOKEN; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { (arg1)->clear(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1is_1available(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jboolean jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (bool)((MeCab::Lattice const *)arg1)->is_available(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1bos_1node(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->bos_node(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1eos_1node(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->eos_node(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1end_1nodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { jlong jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (size_t)jarg2; { try { result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->end_nodes(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1begin_1nodes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { jlong jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (size_t)jarg2; { try { result = (MeCab::Node *)((MeCab::Lattice const *)arg1)->begin_nodes(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1sentence(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (char *)((MeCab::Lattice const *)arg1)->sentence(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1size(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = ((MeCab::Lattice const *)arg1)->size(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jlong)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1Z(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; double arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (double)jarg2; { try { (arg1)->set_Z(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jdouble JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1Z(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jdouble jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; double result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (double)((MeCab::Lattice const *)arg1)->Z(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jdouble)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1theta(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jfloat jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; float arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (float)jarg2; { try { (arg1)->set_theta(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jfloat JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1theta(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jfloat jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; float result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (float)((MeCab::Lattice const *)arg1)->theta(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jfloat)result; return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1next(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jboolean jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (bool)(arg1)->next(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1request_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (int)((MeCab::Lattice const *)arg1)->request_type(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1has_1request_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { jboolean jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (int)jarg2; { try { result = (bool)((MeCab::Lattice const *)arg1)->has_request_type(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1request_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (int)jarg2; { try { (arg1)->set_request_type(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1add_1request_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (int)jarg2; { try { (arg1)->add_request_type(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1remove_1request_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; int arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (int)jarg2; { try { (arg1)->remove_request_type(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1newNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (MeCab::Node *)(arg1)->newNode(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1toString_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (char *)(arg1)->toString(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1toString_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jstring jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; MeCab::Node *arg2 = (MeCab::Node *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; (void)jarg2_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = *(MeCab::Node **)&jarg2; { try { result = (char *)(arg1)->toString((MeCab::Node const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1enumNBestAsString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { jstring jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (size_t)jarg2; { try { result = (char *)(arg1)->enumNBestAsString(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1has_1constraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jboolean jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (bool)((MeCab::Lattice const *)arg1)->has_constraint(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1boundary_1constraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { jint jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (size_t)jarg2; { try { result = (int)((MeCab::Lattice const *)arg1)->boundary_constraint(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1feature_1constraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { jstring jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (size_t)jarg2; { try { result = (char *)((MeCab::Lattice const *)arg1)->feature_constraint(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1boundary_1constraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jint jarg3) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; int arg3 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (size_t)jarg2; arg3 = (int)jarg3; { try { (arg1)->set_boundary_constraint(arg2,arg3); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1feature_1constraint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jstring jarg4) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; size_t arg2 ; size_t arg3 ; char *arg4 = (char *) 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = (size_t)jarg2; arg3 = (size_t)jarg3; arg4 = 0; if (jarg4) { arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); if (!arg4) return ; } { try { (arg1)->set_feature_constraint(arg2,arg3,(char const *)arg4); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1result(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *arg2 = (char *) 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return ; } { try { (arg1)->set_result((char const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1what(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; { try { result = (char *)((MeCab::Lattice const *)arg1)->what(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1what(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *arg2 = (char *) 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return ; } { try { (arg1)->set_what((char const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_delete_1Lattice(JNIEnv *jenv, jclass jcls, jlong jarg1) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; (void)jenv; (void)jcls; arg1 = *(MeCab::Lattice **)&jarg1; { try { delete arg1; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_new_1Lattice(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; MeCab::Lattice *result = 0 ; (void)jenv; (void)jcls; { try { result = (MeCab::Lattice *)new_MeCab_Lattice(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Lattice **)&jresult = result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Lattice_1set_1sentence(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { MeCab::Lattice *arg1 = (MeCab::Lattice *) 0 ; char *arg2 = (char *) 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Lattice **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return ; } { try { MeCab_Lattice_set_sentence(arg1,(char const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1dictionary_1info(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::DictionaryInfo *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Model **)&jarg1; { try { result = (MeCab::DictionaryInfo *)((MeCab::Model const *)arg1)->dictionary_info(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::DictionaryInfo **)&jresult = result; return jresult; } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1transition_1cost(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { jint jresult = 0 ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; unsigned short arg2 ; unsigned short arg3 ; int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Model **)&jarg1; arg2 = (unsigned short)jarg2; arg3 = (unsigned short)jarg3; { try { result = (int)((MeCab::Model const *)arg1)->transition_cost(arg2,arg3); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1lookup(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jlong jarg4, jobject jarg4_) { jlong jresult = 0 ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; MeCab::Lattice *arg4 = (MeCab::Lattice *) 0 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; (void)jarg4_; arg1 = *(MeCab::Model **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return 0; } arg3 = 0; if (jarg3) { arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); if (!arg3) return 0; } arg4 = *(MeCab::Lattice **)&jarg4; { try { result = (MeCab::Node *)((MeCab::Model const *)arg1)->lookup((char const *)arg2,(char const *)arg3,arg4); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1createTagger(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::Tagger *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Model **)&jarg1; { try { result = (MeCab::Tagger *)((MeCab::Model const *)arg1)->createTagger(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Tagger **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1createLattice(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::Lattice *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Model **)&jarg1; { try { result = (MeCab::Lattice *)((MeCab::Model const *)arg1)->createLattice(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Lattice **)&jresult = result; return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1swap(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jboolean jresult = 0 ; MeCab::Model *arg1 = (MeCab::Model *) 0 ; MeCab::Model *arg2 = (MeCab::Model *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; (void)jarg2_; arg1 = *(MeCab::Model **)&jarg1; arg2 = *(MeCab::Model **)&jarg2; { try { result = (bool)(arg1)->swap(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1version(JNIEnv *jenv, jclass jcls) { jstring jresult = 0 ; char *result = 0 ; (void)jenv; (void)jcls; { try { result = (char *)MeCab::Model::version(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_delete_1Model(JNIEnv *jenv, jclass jcls, jlong jarg1) { MeCab::Model *arg1 = (MeCab::Model *) 0 ; (void)jenv; (void)jcls; arg1 = *(MeCab::Model **)&jarg1; { try { delete arg1; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1create_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { jlong jresult = 0 ; int arg1 ; char **arg2 = (char **) 0 ; MeCab::Model *result = 0 ; (void)jenv; (void)jcls; arg1 = (int)jarg1; arg2 = *(char ***)&jarg2; { try { result = (MeCab::Model *)MeCab::Model::create(arg1,arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Model **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Model_1create_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { jlong jresult = 0 ; char *arg1 = (char *) 0 ; MeCab::Model *result = 0 ; (void)jenv; (void)jcls; arg1 = 0; if (jarg1) { arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); if (!arg1) return 0; } { try { result = (MeCab::Model *)MeCab::Model::create((char const *)arg1); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Model **)&jresult = result; if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_new_1Model_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1) { jlong jresult = 0 ; char *arg1 = (char *) 0 ; MeCab::Model *result = 0 ; (void)jenv; (void)jcls; arg1 = 0; if (jarg1) { arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); if (!arg1) return 0; } { try { result = (MeCab::Model *)new_MeCab_Model((char const *)arg1); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Model **)&jresult = result; if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_new_1Model_1_1SWIG_11(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; MeCab::Model *result = 0 ; (void)jenv; (void)jcls; { try { result = (MeCab::Model *)new_MeCab_Model(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Model **)&jresult = result; return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parse_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jboolean jresult = 0 ; MeCab::Model *arg1 = 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; (void)jarg2_; arg1 = *(MeCab::Model **)&jarg1; if (!arg1) { SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "MeCab::Model const & reference is null"); return 0; } arg2 = *(MeCab::Lattice **)&jarg2; { try { result = (bool)MeCab::Tagger::parse((MeCab::Model const &)*arg1,arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parse_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jboolean jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Lattice *arg2 = (MeCab::Lattice *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; (void)jarg2_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = *(MeCab::Lattice **)&jarg2; { try { result = (bool)((MeCab::Tagger const *)arg1)->parse(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parse_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { jstring jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return 0; } { try { result = (char *)(arg1)->parse((char const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parseToNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { jlong jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return 0; } { try { result = (MeCab::Node *)(arg1)->parseToNode((char const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parseNBest(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jstring jarg3) { jstring jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; size_t arg2 ; char *arg3 = (char *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = (size_t)jarg2; arg3 = 0; if (jarg3) { arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); if (!arg3) return 0; } { try { result = (char *)(arg1)->parseNBest(arg2,(char const *)arg3); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parseNBestInit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { jboolean jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return 0; } { try { result = (bool)(arg1)->parseNBestInit((char const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1nextNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Node *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (MeCab::Node *)(arg1)->nextNode(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Node **)&jresult = result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1next(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (char *)(arg1)->next(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1formatNode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { jstring jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::Node *arg2 = (MeCab::Node *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; (void)jarg2_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = *(MeCab::Node **)&jarg2; { try { result = (char *)(arg1)->formatNode((MeCab::Node const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1set_1request_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = (int)jarg2; { try { (arg1)->set_request_type(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1request_1type(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (int)((MeCab::Tagger const *)arg1)->request_type(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1partial(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jboolean jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (bool)((MeCab::Tagger const *)arg1)->partial(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1set_1partial(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = jarg2 ? true : false; { try { (arg1)->set_partial(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jint JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1lattice_1level(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (int)((MeCab::Tagger const *)arg1)->lattice_level(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jint)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1set_1lattice_1level(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; int arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = (int)jarg2; { try { (arg1)->set_lattice_level(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jboolean JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1all_1morphs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jboolean jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (bool)((MeCab::Tagger const *)arg1)->all_morphs(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jboolean)result; return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1set_1all_1morphs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; bool arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = jarg2 ? true : false; { try { (arg1)->set_all_morphs(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1set_1theta(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jfloat jarg2) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; float arg2 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = (float)jarg2; { try { (arg1)->set_theta(arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jfloat JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1theta(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jfloat jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; float result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (float)((MeCab::Tagger const *)arg1)->theta(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } jresult = (jfloat)result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1dictionary_1info(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; MeCab::DictionaryInfo *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (MeCab::DictionaryInfo *)((MeCab::Tagger const *)arg1)->dictionary_info(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::DictionaryInfo **)&jresult = result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1what(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; { try { result = (char *)((MeCab::Tagger const *)arg1)->what(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT void JNICALL Java_org_chasen_mecab_MeCabJNI_delete_1Tagger(JNIEnv *jenv, jclass jcls, jlong jarg1) { MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; (void)jenv; (void)jcls; arg1 = *(MeCab::Tagger **)&jarg1; { try { delete arg1; } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return ; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return ; }; } } } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1create_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { jlong jresult = 0 ; int arg1 ; char **arg2 = (char **) 0 ; MeCab::Tagger *result = 0 ; (void)jenv; (void)jcls; arg1 = (int)jarg1; arg2 = *(char ***)&jarg2; { try { result = (MeCab::Tagger *)MeCab::Tagger::create(arg1,arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Tagger **)&jresult = result; return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1create_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { jlong jresult = 0 ; char *arg1 = (char *) 0 ; MeCab::Tagger *result = 0 ; (void)jenv; (void)jcls; arg1 = 0; if (jarg1) { arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); if (!arg1) return 0; } { try { result = (MeCab::Tagger *)MeCab::Tagger::create((char const *)arg1); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Tagger **)&jresult = result; if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1version(JNIEnv *jenv, jclass jcls) { jstring jresult = 0 ; char *result = 0 ; (void)jenv; (void)jcls; { try { result = (char *)MeCab::Tagger::version(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_new_1Tagger_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1) { jlong jresult = 0 ; char *arg1 = (char *) 0 ; MeCab::Tagger *result = 0 ; (void)jenv; (void)jcls; arg1 = 0; if (jarg1) { arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); if (!arg1) return 0; } { try { result = (MeCab::Tagger *)new_MeCab_Tagger((char const *)arg1); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Tagger **)&jresult = result; if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); return jresult; } SWIGEXPORT jlong JNICALL Java_org_chasen_mecab_MeCabJNI_new_1Tagger_1_1SWIG_11(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; MeCab::Tagger *result = 0 ; (void)jenv; (void)jcls; { try { result = (MeCab::Tagger *)new_MeCab_Tagger(); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } *(MeCab::Tagger **)&jresult = result; return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parseToString_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { jstring jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; size_t arg3 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return 0; } arg3 = (size_t)jarg3; { try { result = (char *)MeCab_Tagger_parseToString__SWIG_0(arg1,(char const *)arg2,arg3); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_Tagger_1parseToString_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { jstring jresult = 0 ; MeCab::Tagger *arg1 = (MeCab::Tagger *) 0 ; char *arg2 = (char *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(MeCab::Tagger **)&jarg1; arg2 = 0; if (jarg2) { arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return 0; } { try { result = (char *)MeCab_Tagger_parseToString__SWIG_0(arg1,(char const *)arg2); } catch (char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, e); return 0; }; } catch (const char *e) { { SWIG_JavaException(jenv, SWIG_RuntimeError, (char*)e); return 0; }; } } if (result) jresult = jenv->NewStringUTF((const char *)result); if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); return jresult; } SWIGEXPORT jstring JNICALL Java_org_chasen_mecab_MeCabJNI_VERSION_1get(JNIEnv *jenv, jclass jcls) { jstring jresult = 0 ; char *result = 0 ; (void)jenv; (void)jcls; result = (char *)("0.996"); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } #ifdef __cplusplus } #endif mecab-java-0.996/AUTHORS0000644002562000116100000000003412110211100013044 0ustar takuengTaku Kudo mecab-java-0.996/bindings.html0000644002562000116100000002240112110211100014461 0ustar takueng スクリプト言語のバインディング

スクリプト言語のバインディング

概要

各種スクリプト言語 (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-java-0.996/GPL0000644002562000116100000004313112110211100012346 0ustar takueng 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-java-0.996/Makefile0000644002562000116100000000105712110211100013442 0ustar takuengTARGET=MeCab JAVAC=javac JAVA=java JAR=jar CXX=c++ INCLUDE=/usr/lib/jvm/java-6-openjdk/include PACKAGE=org/chasen/mecab LIBS=`mecab-config --libs` INC=`mecab-config --cflags` -I$(INCLUDE) -I$(INCLUDE)/linux all: $(CXX) -O3 -c -fpic $(TARGET)_wrap.cxx $(INC) $(CXX) -shared $(TARGET)_wrap.o -o lib$(TARGET).so $(LIBS) $(JAVAC) $(PACKAGE)/*.java $(JAVAC) test.java $(JAR) cfv $(TARGET).jar $(PACKAGE)/*.class test: env LD_LIBRARY_PATH=. $(JAVA) test clean: rm -fr *.jar *.o *.so *.class $(PACKAGE)/*.class cleanall: rm -fr $(TARGET).java *.cxx mecab-java-0.996/BSD0000644002562000116100000000310212110211100012326 0ustar takuengCopyright (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-java-0.996/org/0000755002562000116100000000000012110211100012566 5ustar takuengmecab-java-0.996/org/chasen/0000755002562000116100000000000012110211100014027 5ustar takuengmecab-java-0.996/org/chasen/mecab/0000755002562000116100000000000012110211100015076 5ustar takuengmecab-java-0.996/org/chasen/mecab/MeCab.java0000644002562000116100000000070012110211100016705 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class MeCab implements MeCabConstants { } mecab-java-0.996/org/chasen/mecab/MeCabJNI.java0000644002562000116100000002563112110211100017260 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class MeCabJNI { public final static native String DictionaryInfo_filename_get(long jarg1, DictionaryInfo jarg1_); public final static native String DictionaryInfo_charset_get(long jarg1, DictionaryInfo jarg1_); public final static native long DictionaryInfo_size_get(long jarg1, DictionaryInfo jarg1_); public final static native int DictionaryInfo_type_get(long jarg1, DictionaryInfo jarg1_); public final static native long DictionaryInfo_lsize_get(long jarg1, DictionaryInfo jarg1_); public final static native long DictionaryInfo_rsize_get(long jarg1, DictionaryInfo jarg1_); public final static native int DictionaryInfo_version_get(long jarg1, DictionaryInfo jarg1_); public final static native long DictionaryInfo_next_get(long jarg1, DictionaryInfo jarg1_); public final static native long new_DictionaryInfo(); public final static native void delete_DictionaryInfo(long jarg1); public final static native long Path_rnode_get(long jarg1, Path jarg1_); public final static native long Path_rnext_get(long jarg1, Path jarg1_); public final static native long Path_lnode_get(long jarg1, Path jarg1_); public final static native long Path_lnext_get(long jarg1, Path jarg1_); public final static native int Path_cost_get(long jarg1, Path jarg1_); public final static native void Path_prob_set(long jarg1, Path jarg1_, float jarg2); public final static native float Path_prob_get(long jarg1, Path jarg1_); public final static native long Node_prev_get(long jarg1, Node jarg1_); public final static native long Node_next_get(long jarg1, Node jarg1_); public final static native long Node_enext_get(long jarg1, Node jarg1_); public final static native long Node_bnext_get(long jarg1, Node jarg1_); public final static native long Node_rpath_get(long jarg1, Node jarg1_); public final static native long Node_lpath_get(long jarg1, Node jarg1_); public final static native String Node_feature_get(long jarg1, Node jarg1_); public final static native long Node_id_get(long jarg1, Node jarg1_); public final static native int Node_length_get(long jarg1, Node jarg1_); public final static native int Node_rlength_get(long jarg1, Node jarg1_); public final static native int Node_rcAttr_get(long jarg1, Node jarg1_); public final static native int Node_lcAttr_get(long jarg1, Node jarg1_); public final static native int Node_posid_get(long jarg1, Node jarg1_); public final static native short Node_char_type_get(long jarg1, Node jarg1_); public final static native short Node_stat_get(long jarg1, Node jarg1_); public final static native short Node_isbest_get(long jarg1, Node jarg1_); public final static native float Node_alpha_get(long jarg1, Node jarg1_); public final static native float Node_beta_get(long jarg1, Node jarg1_); public final static native void Node_prob_set(long jarg1, Node jarg1_, float jarg2); public final static native float Node_prob_get(long jarg1, Node jarg1_); public final static native short Node_wcost_get(long jarg1, Node jarg1_); public final static native int Node_cost_get(long jarg1, Node jarg1_); public final static native String Node_surface_get(long jarg1, Node jarg1_); public final static native int MECAB_NOR_NODE_get(); public final static native int MECAB_UNK_NODE_get(); public final static native int MECAB_BOS_NODE_get(); public final static native int MECAB_EOS_NODE_get(); public final static native int MECAB_EON_NODE_get(); public final static native int MECAB_SYS_DIC_get(); public final static native int MECAB_USR_DIC_get(); public final static native int MECAB_UNK_DIC_get(); public final static native int MECAB_ONE_BEST_get(); public final static native int MECAB_NBEST_get(); public final static native int MECAB_PARTIAL_get(); public final static native int MECAB_MARGINAL_PROB_get(); public final static native int MECAB_ALTERNATIVE_get(); public final static native int MECAB_ALL_MORPHS_get(); public final static native int MECAB_ALLOCATE_SENTENCE_get(); public final static native int MECAB_ANY_BOUNDARY_get(); public final static native int MECAB_TOKEN_BOUNDARY_get(); public final static native int MECAB_INSIDE_TOKEN_get(); public final static native void Lattice_clear(long jarg1, Lattice jarg1_); public final static native boolean Lattice_is_available(long jarg1, Lattice jarg1_); public final static native long Lattice_bos_node(long jarg1, Lattice jarg1_); public final static native long Lattice_eos_node(long jarg1, Lattice jarg1_); public final static native long Lattice_end_nodes(long jarg1, Lattice jarg1_, long jarg2); public final static native long Lattice_begin_nodes(long jarg1, Lattice jarg1_, long jarg2); public final static native String Lattice_sentence(long jarg1, Lattice jarg1_); public final static native long Lattice_size(long jarg1, Lattice jarg1_); public final static native void Lattice_set_Z(long jarg1, Lattice jarg1_, double jarg2); public final static native double Lattice_Z(long jarg1, Lattice jarg1_); public final static native void Lattice_set_theta(long jarg1, Lattice jarg1_, float jarg2); public final static native float Lattice_theta(long jarg1, Lattice jarg1_); public final static native boolean Lattice_next(long jarg1, Lattice jarg1_); public final static native int Lattice_request_type(long jarg1, Lattice jarg1_); public final static native boolean Lattice_has_request_type(long jarg1, Lattice jarg1_, int jarg2); public final static native void Lattice_set_request_type(long jarg1, Lattice jarg1_, int jarg2); public final static native void Lattice_add_request_type(long jarg1, Lattice jarg1_, int jarg2); public final static native void Lattice_remove_request_type(long jarg1, Lattice jarg1_, int jarg2); public final static native long Lattice_newNode(long jarg1, Lattice jarg1_); public final static native String Lattice_toString__SWIG_0(long jarg1, Lattice jarg1_); public final static native String Lattice_toString__SWIG_1(long jarg1, Lattice jarg1_, long jarg2, Node jarg2_); public final static native String Lattice_enumNBestAsString(long jarg1, Lattice jarg1_, long jarg2); public final static native boolean Lattice_has_constraint(long jarg1, Lattice jarg1_); public final static native int Lattice_boundary_constraint(long jarg1, Lattice jarg1_, long jarg2); public final static native String Lattice_feature_constraint(long jarg1, Lattice jarg1_, long jarg2); public final static native void Lattice_set_boundary_constraint(long jarg1, Lattice jarg1_, long jarg2, int jarg3); public final static native void Lattice_set_feature_constraint(long jarg1, Lattice jarg1_, long jarg2, long jarg3, String jarg4); public final static native void Lattice_set_result(long jarg1, Lattice jarg1_, String jarg2); public final static native String Lattice_what(long jarg1, Lattice jarg1_); public final static native void Lattice_set_what(long jarg1, Lattice jarg1_, String jarg2); public final static native void delete_Lattice(long jarg1); public final static native long new_Lattice(); public final static native void Lattice_set_sentence(long jarg1, Lattice jarg1_, String jarg2); public final static native long Model_dictionary_info(long jarg1, Model jarg1_); public final static native int Model_transition_cost(long jarg1, Model jarg1_, int jarg2, int jarg3); public final static native long Model_lookup(long jarg1, Model jarg1_, String jarg2, String jarg3, long jarg4, Lattice jarg4_); public final static native long Model_createTagger(long jarg1, Model jarg1_); public final static native long Model_createLattice(long jarg1, Model jarg1_); public final static native boolean Model_swap(long jarg1, Model jarg1_, long jarg2, Model jarg2_); public final static native String Model_version(); public final static native void delete_Model(long jarg1); public final static native long Model_create__SWIG_0(int jarg1, long jarg2); public final static native long Model_create__SWIG_1(String jarg1); public final static native long new_Model__SWIG_0(String jarg1); public final static native long new_Model__SWIG_1(); public final static native boolean Tagger_parse__SWIG_0(long jarg1, Model jarg1_, long jarg2, Lattice jarg2_); public final static native boolean Tagger_parse__SWIG_1(long jarg1, Tagger jarg1_, long jarg2, Lattice jarg2_); public final static native String Tagger_parse__SWIG_2(long jarg1, Tagger jarg1_, String jarg2); public final static native long Tagger_parseToNode(long jarg1, Tagger jarg1_, String jarg2); public final static native String Tagger_parseNBest(long jarg1, Tagger jarg1_, long jarg2, String jarg3); public final static native boolean Tagger_parseNBestInit(long jarg1, Tagger jarg1_, String jarg2); public final static native long Tagger_nextNode(long jarg1, Tagger jarg1_); public final static native String Tagger_next(long jarg1, Tagger jarg1_); public final static native String Tagger_formatNode(long jarg1, Tagger jarg1_, long jarg2, Node jarg2_); public final static native void Tagger_set_request_type(long jarg1, Tagger jarg1_, int jarg2); public final static native int Tagger_request_type(long jarg1, Tagger jarg1_); public final static native boolean Tagger_partial(long jarg1, Tagger jarg1_); public final static native void Tagger_set_partial(long jarg1, Tagger jarg1_, boolean jarg2); public final static native int Tagger_lattice_level(long jarg1, Tagger jarg1_); public final static native void Tagger_set_lattice_level(long jarg1, Tagger jarg1_, int jarg2); public final static native boolean Tagger_all_morphs(long jarg1, Tagger jarg1_); public final static native void Tagger_set_all_morphs(long jarg1, Tagger jarg1_, boolean jarg2); public final static native void Tagger_set_theta(long jarg1, Tagger jarg1_, float jarg2); public final static native float Tagger_theta(long jarg1, Tagger jarg1_); public final static native long Tagger_dictionary_info(long jarg1, Tagger jarg1_); public final static native String Tagger_what(long jarg1, Tagger jarg1_); public final static native void delete_Tagger(long jarg1); public final static native long Tagger_create__SWIG_0(int jarg1, long jarg2); public final static native long Tagger_create__SWIG_1(String jarg1); public final static native String Tagger_version(); public final static native long new_Tagger__SWIG_0(String jarg1); public final static native long new_Tagger__SWIG_1(); public final static native String Tagger_parseToString__SWIG_0(long jarg1, Tagger jarg1_, String jarg2, long jarg3); public final static native String Tagger_parseToString__SWIG_1(long jarg1, Tagger jarg1_, String jarg2); public final static native String VERSION_get(); } mecab-java-0.996/org/chasen/mecab/DictionaryInfo.java0000644002562000116100000000353112110211100020664 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class DictionaryInfo { private long swigCPtr; protected boolean swigCMemOwn; public DictionaryInfo(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } public static long getCPtr(DictionaryInfo obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; MeCabJNI.delete_DictionaryInfo(swigCPtr); } swigCPtr = 0; } } public String getFilename() { return MeCabJNI.DictionaryInfo_filename_get(swigCPtr, this); } public String getCharset() { return MeCabJNI.DictionaryInfo_charset_get(swigCPtr, this); } public long getSize() { return MeCabJNI.DictionaryInfo_size_get(swigCPtr, this); } public int getType() { return MeCabJNI.DictionaryInfo_type_get(swigCPtr, this); } public long getLsize() { return MeCabJNI.DictionaryInfo_lsize_get(swigCPtr, this); } public long getRsize() { return MeCabJNI.DictionaryInfo_rsize_get(swigCPtr, this); } public int getVersion() { return MeCabJNI.DictionaryInfo_version_get(swigCPtr, this); } public DictionaryInfo getNext() { long cPtr = MeCabJNI.DictionaryInfo_next_get(swigCPtr, this); return (cPtr == 0) ? null : new DictionaryInfo(cPtr, false); } public DictionaryInfo() { this(MeCabJNI.new_DictionaryInfo(), true); } } mecab-java-0.996/org/chasen/mecab/SWIGTYPE_p_p_char.java0000644002562000116100000000131012110211100021042 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class SWIGTYPE_p_p_char { private long swigCPtr; protected SWIGTYPE_p_p_char(long cPtr, boolean futureUse) { swigCPtr = cPtr; } protected SWIGTYPE_p_p_char() { swigCPtr = 0; } protected static long getCPtr(SWIGTYPE_p_p_char obj) { return (obj == null) ? 0 : obj.swigCPtr; } } mecab-java-0.996/org/chasen/mecab/Path.java0000644002562000116100000000333612110211100016642 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class Path { private long swigCPtr; protected boolean swigCMemOwn; public Path(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } public static long getCPtr(Path obj) { return (obj == null) ? 0 : obj.swigCPtr; } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; throw new UnsupportedOperationException("C++ destructor does not have public access"); } swigCPtr = 0; } } public Node getRnode() { long cPtr = MeCabJNI.Path_rnode_get(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Path getRnext() { long cPtr = MeCabJNI.Path_rnext_get(swigCPtr, this); return (cPtr == 0) ? null : new Path(cPtr, false); } public Node getLnode() { long cPtr = MeCabJNI.Path_lnode_get(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Path getLnext() { long cPtr = MeCabJNI.Path_lnext_get(swigCPtr, this); return (cPtr == 0) ? null : new Path(cPtr, false); } public int getCost() { return MeCabJNI.Path_cost_get(swigCPtr, this); } public void setProb(float value) { MeCabJNI.Path_prob_set(swigCPtr, this, value); } public float getProb() { return MeCabJNI.Path_prob_get(swigCPtr, this); } } mecab-java-0.996/org/chasen/mecab/Lattice.java0000644002562000116100000001071312110211100017330 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class Lattice { private long swigCPtr; protected boolean swigCMemOwn; public Lattice(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } public static long getCPtr(Lattice obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; MeCabJNI.delete_Lattice(swigCPtr); } swigCPtr = 0; } } public void clear() { MeCabJNI.Lattice_clear(swigCPtr, this); } public boolean is_available() { return MeCabJNI.Lattice_is_available(swigCPtr, this); } public Node bos_node() { long cPtr = MeCabJNI.Lattice_bos_node(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Node eos_node() { long cPtr = MeCabJNI.Lattice_eos_node(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Node end_nodes(long pos) { long cPtr = MeCabJNI.Lattice_end_nodes(swigCPtr, this, pos); return (cPtr == 0) ? null : new Node(cPtr, false); } public Node begin_nodes(long pos) { long cPtr = MeCabJNI.Lattice_begin_nodes(swigCPtr, this, pos); return (cPtr == 0) ? null : new Node(cPtr, false); } public String sentence() { return MeCabJNI.Lattice_sentence(swigCPtr, this); } public long size() { return MeCabJNI.Lattice_size(swigCPtr, this); } public void set_Z(double Z) { MeCabJNI.Lattice_set_Z(swigCPtr, this, Z); } public double Z() { return MeCabJNI.Lattice_Z(swigCPtr, this); } public void set_theta(float theta) { MeCabJNI.Lattice_set_theta(swigCPtr, this, theta); } public float theta() { return MeCabJNI.Lattice_theta(swigCPtr, this); } public boolean next() { return MeCabJNI.Lattice_next(swigCPtr, this); } public int request_type() { return MeCabJNI.Lattice_request_type(swigCPtr, this); } public boolean has_request_type(int request_type) { return MeCabJNI.Lattice_has_request_type(swigCPtr, this, request_type); } public void set_request_type(int request_type) { MeCabJNI.Lattice_set_request_type(swigCPtr, this, request_type); } public void add_request_type(int request_type) { MeCabJNI.Lattice_add_request_type(swigCPtr, this, request_type); } public void remove_request_type(int request_type) { MeCabJNI.Lattice_remove_request_type(swigCPtr, this, request_type); } public Node newNode() { long cPtr = MeCabJNI.Lattice_newNode(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public String toString() { return MeCabJNI.Lattice_toString__SWIG_0(swigCPtr, this); } public String toString(Node node) { return MeCabJNI.Lattice_toString__SWIG_1(swigCPtr, this, Node.getCPtr(node), node); } public String enumNBestAsString(long N) { return MeCabJNI.Lattice_enumNBestAsString(swigCPtr, this, N); } public boolean has_constraint() { return MeCabJNI.Lattice_has_constraint(swigCPtr, this); } public int boundary_constraint(long pos) { return MeCabJNI.Lattice_boundary_constraint(swigCPtr, this, pos); } public String feature_constraint(long pos) { return MeCabJNI.Lattice_feature_constraint(swigCPtr, this, pos); } public void set_boundary_constraint(long pos, int boundary_constraint_type) { MeCabJNI.Lattice_set_boundary_constraint(swigCPtr, this, pos, boundary_constraint_type); } public void set_feature_constraint(long begin_pos, long end_pos, String feature) { MeCabJNI.Lattice_set_feature_constraint(swigCPtr, this, begin_pos, end_pos, feature); } public void set_result(String result) { MeCabJNI.Lattice_set_result(swigCPtr, this, result); } public String what() { return MeCabJNI.Lattice_what(swigCPtr, this); } public void set_what(String str) { MeCabJNI.Lattice_set_what(swigCPtr, this, str); } public Lattice() { this(MeCabJNI.new_Lattice(), true); } public void set_sentence(String sentence) { MeCabJNI.Lattice_set_sentence(swigCPtr, this, sentence); } } mecab-java-0.996/org/chasen/mecab/Node.java0000644002562000116100000000625112110211100016632 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class Node { private long swigCPtr; protected boolean swigCMemOwn; public Node(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } public static long getCPtr(Node obj) { return (obj == null) ? 0 : obj.swigCPtr; } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; throw new UnsupportedOperationException("C++ destructor does not have public access"); } swigCPtr = 0; } } public Node getPrev() { long cPtr = MeCabJNI.Node_prev_get(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Node getNext() { long cPtr = MeCabJNI.Node_next_get(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Node getEnext() { long cPtr = MeCabJNI.Node_enext_get(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Node getBnext() { long cPtr = MeCabJNI.Node_bnext_get(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public Path getRpath() { long cPtr = MeCabJNI.Node_rpath_get(swigCPtr, this); return (cPtr == 0) ? null : new Path(cPtr, false); } public Path getLpath() { long cPtr = MeCabJNI.Node_lpath_get(swigCPtr, this); return (cPtr == 0) ? null : new Path(cPtr, false); } public String getFeature() { return MeCabJNI.Node_feature_get(swigCPtr, this); } public long getId() { return MeCabJNI.Node_id_get(swigCPtr, this); } public int getLength() { return MeCabJNI.Node_length_get(swigCPtr, this); } public int getRlength() { return MeCabJNI.Node_rlength_get(swigCPtr, this); } public int getRcAttr() { return MeCabJNI.Node_rcAttr_get(swigCPtr, this); } public int getLcAttr() { return MeCabJNI.Node_lcAttr_get(swigCPtr, this); } public int getPosid() { return MeCabJNI.Node_posid_get(swigCPtr, this); } public short getChar_type() { return MeCabJNI.Node_char_type_get(swigCPtr, this); } public short getStat() { return MeCabJNI.Node_stat_get(swigCPtr, this); } public short getIsbest() { return MeCabJNI.Node_isbest_get(swigCPtr, this); } public float getAlpha() { return MeCabJNI.Node_alpha_get(swigCPtr, this); } public float getBeta() { return MeCabJNI.Node_beta_get(swigCPtr, this); } public void setProb(float value) { MeCabJNI.Node_prob_set(swigCPtr, this, value); } public float getProb() { return MeCabJNI.Node_prob_get(swigCPtr, this); } public short getWcost() { return MeCabJNI.Node_wcost_get(swigCPtr, this); } public int getCost() { return MeCabJNI.Node_cost_get(swigCPtr, this); } public String getSurface() { return MeCabJNI.Node_surface_get(swigCPtr, this); } } mecab-java-0.996/org/chasen/mecab/Model.java0000644002562000116100000000470312110211100017005 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class Model { private long swigCPtr; protected boolean swigCMemOwn; public Model(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } public static long getCPtr(Model obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; MeCabJNI.delete_Model(swigCPtr); } swigCPtr = 0; } } public DictionaryInfo dictionary_info() { long cPtr = MeCabJNI.Model_dictionary_info(swigCPtr, this); return (cPtr == 0) ? null : new DictionaryInfo(cPtr, false); } public int transition_cost(int rcAttr, int lcAttr) { return MeCabJNI.Model_transition_cost(swigCPtr, this, rcAttr, lcAttr); } public Node lookup(String begin, String end, Lattice lattice) { long cPtr = MeCabJNI.Model_lookup(swigCPtr, this, begin, end, Lattice.getCPtr(lattice), lattice); return (cPtr == 0) ? null : new Node(cPtr, false); } public Tagger createTagger() { long cPtr = MeCabJNI.Model_createTagger(swigCPtr, this); return (cPtr == 0) ? null : new Tagger(cPtr, false); } public Lattice createLattice() { long cPtr = MeCabJNI.Model_createLattice(swigCPtr, this); return (cPtr == 0) ? null : new Lattice(cPtr, false); } public boolean swap(Model model) { return MeCabJNI.Model_swap(swigCPtr, this, Model.getCPtr(model), model); } public static String version() { return MeCabJNI.Model_version(); } public static Model create(int argc, SWIGTYPE_p_p_char argv) { long cPtr = MeCabJNI.Model_create__SWIG_0(argc, SWIGTYPE_p_p_char.getCPtr(argv)); return (cPtr == 0) ? null : new Model(cPtr, false); } public static Model create(String arg) { long cPtr = MeCabJNI.Model_create__SWIG_1(arg); return (cPtr == 0) ? null : new Model(cPtr, false); } public Model(String argc) { this(MeCabJNI.new_Model__SWIG_0(argc), true); } public Model() { this(MeCabJNI.new_Model__SWIG_1(), true); } } mecab-java-0.996/org/chasen/mecab/MeCabConstants.java0000644002562000116100000000353612110211100020614 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public interface MeCabConstants { public final static int MECAB_NOR_NODE = MeCabJNI.MECAB_NOR_NODE_get(); public final static int MECAB_UNK_NODE = MeCabJNI.MECAB_UNK_NODE_get(); public final static int MECAB_BOS_NODE = MeCabJNI.MECAB_BOS_NODE_get(); public final static int MECAB_EOS_NODE = MeCabJNI.MECAB_EOS_NODE_get(); public final static int MECAB_EON_NODE = MeCabJNI.MECAB_EON_NODE_get(); public final static int MECAB_SYS_DIC = MeCabJNI.MECAB_SYS_DIC_get(); public final static int MECAB_USR_DIC = MeCabJNI.MECAB_USR_DIC_get(); public final static int MECAB_UNK_DIC = MeCabJNI.MECAB_UNK_DIC_get(); public final static int MECAB_ONE_BEST = MeCabJNI.MECAB_ONE_BEST_get(); public final static int MECAB_NBEST = MeCabJNI.MECAB_NBEST_get(); public final static int MECAB_PARTIAL = MeCabJNI.MECAB_PARTIAL_get(); public final static int MECAB_MARGINAL_PROB = MeCabJNI.MECAB_MARGINAL_PROB_get(); public final static int MECAB_ALTERNATIVE = MeCabJNI.MECAB_ALTERNATIVE_get(); public final static int MECAB_ALL_MORPHS = MeCabJNI.MECAB_ALL_MORPHS_get(); public final static int MECAB_ALLOCATE_SENTENCE = MeCabJNI.MECAB_ALLOCATE_SENTENCE_get(); public final static int MECAB_ANY_BOUNDARY = MeCabJNI.MECAB_ANY_BOUNDARY_get(); public final static int MECAB_TOKEN_BOUNDARY = MeCabJNI.MECAB_TOKEN_BOUNDARY_get(); public final static int MECAB_INSIDE_TOKEN = MeCabJNI.MECAB_INSIDE_TOKEN_get(); public final static String VERSION = MeCabJNI.VERSION_get(); } mecab-java-0.996/org/chasen/mecab/Tagger.java0000644002562000116100000001020412110211100017147 0ustar takueng/* ---------------------------------------------------------------------------- * 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 org.chasen.mecab; public class Tagger { private long swigCPtr; protected boolean swigCMemOwn; public Tagger(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } public static long getCPtr(Tagger obj) { return (obj == null) ? 0 : obj.swigCPtr; } protected void finalize() { delete(); } public synchronized void delete() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; MeCabJNI.delete_Tagger(swigCPtr); } swigCPtr = 0; } } public static boolean parse(Model model, Lattice lattice) { return MeCabJNI.Tagger_parse__SWIG_0(Model.getCPtr(model), model, Lattice.getCPtr(lattice), lattice); } public boolean parse(Lattice lattice) { return MeCabJNI.Tagger_parse__SWIG_1(swigCPtr, this, Lattice.getCPtr(lattice), lattice); } public String parse(String str) { return MeCabJNI.Tagger_parse__SWIG_2(swigCPtr, this, str); } public Node parseToNode(String str) { long cPtr = MeCabJNI.Tagger_parseToNode(swigCPtr, this, str); return (cPtr == 0) ? null : new Node(cPtr, false); } public String parseNBest(long N, String str) { return MeCabJNI.Tagger_parseNBest(swigCPtr, this, N, str); } public boolean parseNBestInit(String str) { return MeCabJNI.Tagger_parseNBestInit(swigCPtr, this, str); } public Node nextNode() { long cPtr = MeCabJNI.Tagger_nextNode(swigCPtr, this); return (cPtr == 0) ? null : new Node(cPtr, false); } public String next() { return MeCabJNI.Tagger_next(swigCPtr, this); } public String formatNode(Node node) { return MeCabJNI.Tagger_formatNode(swigCPtr, this, Node.getCPtr(node), node); } public void set_request_type(int request_type) { MeCabJNI.Tagger_set_request_type(swigCPtr, this, request_type); } public int request_type() { return MeCabJNI.Tagger_request_type(swigCPtr, this); } public boolean partial() { return MeCabJNI.Tagger_partial(swigCPtr, this); } public void set_partial(boolean partial) { MeCabJNI.Tagger_set_partial(swigCPtr, this, partial); } public int lattice_level() { return MeCabJNI.Tagger_lattice_level(swigCPtr, this); } public void set_lattice_level(int level) { MeCabJNI.Tagger_set_lattice_level(swigCPtr, this, level); } public boolean all_morphs() { return MeCabJNI.Tagger_all_morphs(swigCPtr, this); } public void set_all_morphs(boolean all_morphs) { MeCabJNI.Tagger_set_all_morphs(swigCPtr, this, all_morphs); } public void set_theta(float theta) { MeCabJNI.Tagger_set_theta(swigCPtr, this, theta); } public float theta() { return MeCabJNI.Tagger_theta(swigCPtr, this); } public DictionaryInfo dictionary_info() { long cPtr = MeCabJNI.Tagger_dictionary_info(swigCPtr, this); return (cPtr == 0) ? null : new DictionaryInfo(cPtr, false); } public String what() { return MeCabJNI.Tagger_what(swigCPtr, this); } public static Tagger create(int argc, SWIGTYPE_p_p_char argv) { long cPtr = MeCabJNI.Tagger_create__SWIG_0(argc, SWIGTYPE_p_p_char.getCPtr(argv)); return (cPtr == 0) ? null : new Tagger(cPtr, false); } public static Tagger create(String arg) { long cPtr = MeCabJNI.Tagger_create__SWIG_1(arg); return (cPtr == 0) ? null : new Tagger(cPtr, false); } public static String version() { return MeCabJNI.Tagger_version(); } public Tagger(String argc) { this(MeCabJNI.new_Tagger__SWIG_0(argc), true); } public Tagger() { this(MeCabJNI.new_Tagger__SWIG_1(), true); } public String parseToString(String str, long length) { return MeCabJNI.Tagger_parseToString__SWIG_0(swigCPtr, this, str, length); } public String parseToString(String str) { return MeCabJNI.Tagger_parseToString__SWIG_1(swigCPtr, this, str); } }