fix: remove jieba compatibility shim

This commit is contained in:
jxxghp
2026-05-23 13:05:32 +08:00
parent 134c441754
commit 5a1a6b47a5
2 changed files with 1 additions and 55 deletions
+1 -11
View File
@@ -1,19 +1,9 @@
import jieba
from app.utils.jieba import cut
def test_cut_accepts_legacy_hmm_argument():
"""验证兼容封装支持旧 jieba.cut 的 HMM 参数名。"""
"""验证分词封装支持旧 jieba.cut 的 HMM 参数名。"""
words = cut("台湾后台测试", HMM=False)
assert "".join(words) == "台湾后台测试"
assert "后台" in words
def test_legacy_jieba_import_uses_compat_entrypoint():
"""验证插件仍可通过旧 jieba.cut 入口使用主程序分词实现。"""
words = list(jieba.cut("台湾后台测试", HMM=False))
assert "".join(words) == "台湾后台测试"
assert "后台" in words