IK word breakers use custom Thesaurus

Source: Internet
Author: User

1, copy IKAnalyzer.cfg.xml to web-inf/classes under, IKAnalyzer.cfg.xml content as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE Properties SYSTEM "Http://java.sun.com/dtd/properties.dtd" >
<properties>
<comment>ik Analyzer Extended Configuration </comment>
<!--users can configure their own extension dictionary here--
<entry key= "Ext_dict" >myExt.dic;</entry>

<!--users can configure their own extension stop word dictionary here--
<entry key= "Ext_stopwords" >stopword.dic;</entry>

</properties>

2. Modify to add a custom thesaurus:
<entry key= "Ext_dict" >myExt.dic;myExt2.dic</entry>

3, Myext.dic format as follows, note myext.dic need to be UTF-8 no BOM format encoding
Deep South
Dong
Shennan
Ground King Building
Red Village Community
Gui Yuan Jie DAO
Guiyuan

4, set UTF-8 no BOM format encoding:
Download notepad++ Editor, open file, choose Format-in UTF-8 no BOM format encoding



IK word breakers use custom Thesaurus

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.