1. 程式人生 > >spring boot 專案中hanlp的配置(可增加自定義詞典)

spring boot 專案中hanlp的配置(可增加自定義詞典)

pom.xml檔案中增加:

com.hankcs hanlp system ${project.basedir}/src/main/resources/lib/hanlp-1.5.2.jar

字典和模型檔案在專案中的位置,其中包括自定義詞典:

在這裡插入圖片描述
data資料夾在專案中的位置:

在這裡插入圖片描述

hanlp.properties檔案的位置:

在這裡插入圖片描述
這樣就可以在web專案中應用。

文章來源於網路