When IKAnalyzer runs in the idea configuration, Main Dictionary not found !!!, Ideaclassnotfound

Source: Internet
Author: User

When IKAnalyzer runs in the idea configuration, Main Dictionary not found !!!, Ideaclassnotfound

After the IKAnalyzer source code is downloaded, the Main Dictionary not found is displayed after the configuration is run !!! Exception

After I followed in, I found that org/wltea/analyzer/dic/main2012.dic was not found in the configuration file. I found that the main2012.dic file was not found in the build directory generated by idea.

 

After I manually put this file into the dic directory, it works. After a query, I found a solution.

Project Structure-> Modules point + on the right side, select 1, point to the resource Directory, select Classes, and click OK

 

 

After the above configuration, you only need to put the resource file required by IKAnalyzer into the resource root directory and modify the path configured in the source code as follows:

// Private static final String PATH_DIC_MAIN = "org/wltea/analyzer/dic/main2012.dic ";
Private static final String PATH_DIC_MAIN = "main2012.dic ";
// Private static final String PATH_DIC_QUANTIFIER = "org/wltea/analyzer/dic/quantifier. dic ";
Private static final String PATH_DIC_QUANTIFIER = "quantifier. dic ";

Then run the Demo normally.

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.