CAS Nlpir java examples and common errors

Source: Internet
Author: User
CAs nlpir java Examples and common errorsFirst code: 1. Download code:Can download the code at the official website http://ictclas.nlpir.org/or Https://github.com/NLPIR-team/NLPIR; 2. Create a projectCreate a folder in E disk E:\java\JNI the Sample\java\jnatest folder in the compressed package to the E:\java\JNI; Copy the file NLPIR.dll and NLPIR.lib in the unpack package Lib\win64 to the project root Create a project with Eclipse, the project path is E:\java\JNI\jnaTest, if the project is not correct, modify the Jna-4.0.0.jar path in build path, delete the project root date folder, and copy the unpacked \data directory to the project root directory ; (If you run the report initialization failure look at the following error record) The following figure:




3. Modify CodeModify the following path in the instance code, the Nlpir file is only written to the filename, no suffix added
4. Operating Results




Common errors: 1. Unable to load file
is because the path to define and initialize the static variables of the interface is wrong:
Clibrary Instance = (clibrary) native.loadlibrary (
"e://xiazai//Chinese participle 20140928//sample//java//jna//jnatest_nlpir//source//nlpir", clibrary.class); This
2.Init fail! initialization failedThat is because Nlpir-ictclas word expiration, download license and put it into data, the problem can be solved; the license download address is:
Https://github.com/NLPIR-team/NLPIR/tree/master/License/license%20for%20a%20month/NLPIR-ICTCLAS%E5%88%86%E8%AF %8d%e7%b3%bb%e7%bb%9f%e6%8e%88%e6%9d%83 download Nlpir.user to overwrite the Nlpir.user file in the date folder in the project








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.