One of the great benefits of HanLP is the offline open source toolkit. In other words, it not only provides free code to download for free, but also makes the hard-collected dictionaries public. This is a selfless act. When I install, I mainly refer to this blog:
blog.csdn.net/article/details?id=50938796
But this blog mainly introduces how to use hanlp in windows, and ubuntu is linux, so there will be differences. Below I mainly introduce the installation and use of unbuntu.
**Install eclipse **
Enter sudo get-apt install eclipse-platform in the terminal to achieve one-click installation, and then find eclipse in the application
Download hanlp
Visit the official website of hanlp: (http://direction is added by yourself) hanlp.linrunsoft.com/services.html
Download hanlp.jar (program package), data.zip (dictionary library), hanlp.properties (configuration file), and the following is the documentation, you don’t need to download it
When downloading data.zip, the download link is a bit obscure, click on the blue data-for-1.2.11.zip, and Baidu cloud link will appear.
Import jar package
Import hanlp into eclipse, the specific process can refer to the website:
jingyan.baidu.com/article/ca41422fc76c4a1eae99ed9f.html
Import configuration file
Copy hanlp.propertie to the bin directory of the project and modify the path of the dictionary
Modify the path of root to the path where data is saved (remember to unzip data)
Programming code demonstration
operation result:
Author: Quincy1994
Recommended Posts