fix: replace fast jieba dependency

This commit is contained in:
jxxghp
2026-05-23 12:59:33 +08:00
parent 00fc8b2f53
commit 134c441754
6 changed files with 68 additions and 14 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
"""中文分词工具。"""
from fast_jieba import cut as fast_jieba_cut
from jieba_next import cut as jieba_next_cut
def cut(text: str, HMM: bool = True, cut_all: bool = False) -> list[str]:
"""
使用 fast-jieba 执行中文分词,并兼容 jieba.cut 的常用参数名。
使用 jieba-next 执行中文分词,并兼容 jieba.cut 的常用参数名。
"""
return fast_jieba_cut(text, hmm=HMM, cut_all=cut_all)
return list(jieba_next_cut(text, HMM=HMM, cut_all=cut_all))