IKAnalyzer 獨立使用 配置擴充套件詞庫

2021-06-26 19:18:02 字數 864 閱讀 2802

網上已有不少教程了。

這裡只說兩點:

dic檔案要用 「無dom的utf-8」格式編碼

dic檔案最好是放在專案的src資料夾下。

我的乙個範例截圖

對應的ikanalyzer.cfg.xml檔案設定如下:

[html]view plain

copy

<

span

style

="font-size:14px;"

>

xmlversion

="1.0"

encoding

="utf-8"

?>

>

<

properties

>

<

comment

>

ik analyzer 擴充套件配置

comment

>

<

entry

key=

"ext_dict"

>

./dic/scut.dic;

entry

>

<

entry

key=

"ext_stopwords"

>

./dic/stopword.dic;

entry

>

properties

>

span

>

IKAnalyzer 獨立使用 配置擴充套件詞典

public class iikanalyzertest ik 分詞 param query return throws ioexception public static listquerywords string query throws ioexception return list 控制台列...

中文分詞器ikanalyzer 簡單使用

依賴 com.janeluo ikanalyzer 2012 u6 測試 測試ikanalyzer中文分詞器 public class iktest 結果 李 天一 現名 李 冠 豐 著名 歌唱家 李 雙江 和 知名 歌唱家 夢 鴿 之子 根據 司法機關 公布 資料 顯示 李 天一 出生於 1996...

thinkPHP5 0框架獨立配置與動態配置方法

獨立配置檔案 新版支援配置檔案分離,只需要配置extra config list引數 在應用公共配置檔案中 例如,不使用獨立配置檔案的話,資料庫配置資訊應該是在config.php中配置如下 資料庫設定 database 資料庫型別 type mysql 程式設計客棧 伺服器位址 hostname ...