Skip to content

Commit 5a1a6b4

Browse files
committed
fix: remove jieba compatibility shim
1 parent 134c441 commit 5a1a6b4

2 files changed

Lines changed: 1 addition & 55 deletions

File tree

jieba/__init__.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

tests/test_jieba_utils.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
import jieba
2-
31
from app.utils.jieba import cut
42

53

64
def test_cut_accepts_legacy_hmm_argument():
7-
"""验证兼容封装仍支持旧 jieba.cut 的 HMM 参数名。"""
5+
"""验证分词封装支持旧 jieba.cut 的 HMM 参数名。"""
86
words = cut("台湾后台测试", HMM=False)
97

108
assert "".join(words) == "台湾后台测试"
119
assert "后台" in words
12-
13-
14-
def test_legacy_jieba_import_uses_compat_entrypoint():
15-
"""验证插件仍可通过旧 jieba.cut 入口使用主程序分词实现。"""
16-
words = list(jieba.cut("台湾后台测试", HMM=False))
17-
18-
assert "".join(words) == "台湾后台测试"
19-
assert "后台" in words

0 commit comments

Comments
 (0)