Download ictclas2011__32_jni, and unzip it to the ICTCLAS50_Linux_RHAS_32_JNI folder. Free
Download ictclas2011__32_jni, and unzip it to the ICTCLAS50_Linux_RHAS_32_JNI folder.
Free in http://linux.linuxidc.com/
The username and password are both www.linuxidc.com
Use ictclas jni in/pub/2011/08/04/Ubuntu/
Create a Java Project in Eclipse and put ICTCLAS under ICTCLAS50_Linux_RHAS_32_JNI/API to the src directory of the Java Project. Put all other content under ICTCLAS50_Linux_RHAS_32_JNI/API to the root directory of the Java Project, create a new java class named Test. In ICTCLAS50_Linux_RHAS_32_JNI/Doc, there is an ICTCLAS50 API usage instruction. Page 22nd is the first JNI sample program. Copy the content of this program to Test. java. Or directly use the following code:
Import ICTCLAS. i3S. AC. *; public class Test {public static void main (String [] args) {try {ICTCLAS50 testICTCLAS50 = new ICTCLAS50 (); // library required for word segmentation (that is, the Data folder) path String argu = ". "; // initialize if (testICTCLAS50.ICTCLAS _ Init (argu. getBytes ("GB2312") = false) {System. out. println ("Init Fail! "); Return;} else {System. out. println (" Init Succeed! ");} String sInput =" if you are interested in any content on this website, please contact us: Orisun@ymail.com. Republic of China "; byte nativeBytes [] = testICTCLAS50.ICTCLAS _ ParagraphProcess (sInput. getBytes ("GB2312"), 0, 0); // System. out. println (nativeBytes. length); String nativeStr = new String (nativeBytes, 0, nativeBytes. length, "GB2312"); // System. out. println ("The result is:" + nativeStr); String [] rest = nativeStr. split ("\ s +"); for (int I = 0; I